﻿<template>
  <div class="residents-container">
    <el-dialog
      v-model="dialogObj.isDialogVisible"
      :title="dialogObj.editResidentsTitle"
      top="5vh"
      height="70vh"
      lock-scroll
      :width="1300"
      draggable
      class="res-add"
      @close="handleClose"
      @open="handleOpen"
    >
      <div class="res-add-content">
        <!-- :visible.sync="visible" -->
        <!-- 基本信息 -->
        <el-form
          :model="ruleForm"
          ref="ruleFormRef"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules"
        >
          <h3 class="ml20" id="part1">基本信息</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="姓名：" prop="name">
                <el-input
                  v-model="ruleForm.name"
                  disabled
                  clearable
                  style="width: 250px; height: 32px"
                  :maxlength="20"
                  ref="NameInput"
                  @keydown.enter.native="nextInput('carNumberInput')"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="联系电话：" prop="phoneNumber">
                <el-input
                  v-model="ruleForm.phoneNumber"
                  clearable
                  disabled
                  style="width: 250px; height: 32px"
                  ref="phoneNumberInput"
                  @keydown.enter.native="nextInput('exaTimeDiabetesInput')"
                />
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="证件类型：" prop="cardType">
                <el-select
                  v-model="ruleForm.cardType"
                  disabled
                  placeholder="请选择证件类型"
                  style="width: 100%"
                >
                  <el-option label="居民身份证" value="居民身份证"></el-option>
                  <el-option
                    label="港澳台居民身份证"
                    value="港澳台居民身份证"
                  ></el-option>
                  <el-option
                    label="外国人永久居留身份证"
                    value="外国人永久居留身份证"
                  ></el-option>
                  <el-option
                    label="港澳台居民居住证"
                    value="港澳台居民居住证"
                  ></el-option>
                  <el-option label="居民户口本" value="居民户口本"></el-option>
                  <el-option label="护照" value="护照"></el-option>
                  <el-option label="军官证" value="军官证"></el-option>
                  <el-option label="文职干部证" value="文职干部证"></el-option>
                  <el-option label="士兵证" value="士兵证"></el-option>
                  <el-option label="驾驶执照" value="驾驶执照"></el-option>
                  <el-option label="出生证" value="出生证"></el-option>
                  <el-option label="其他" value="其他"></el-option>
                  <el-option label="儿保卡" value="儿保卡"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="证件号码：" prop="cardNumber">
                <el-input
                  disabled
                  v-model="ruleForm.cardNumber"
                  clearable
                  style="width: 250px; height: 32px"
                  ref="carNumberInput"
                  @keydown.enter.native="nextInput('birthdayInput')"
                />
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="出生日期：" prop="birthday">
                <el-date-picker
                  v-model="ruleForm.birthday"
                  :disabled-date="disableFutureDates"
                  disabled
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  style="width: 250px; height: 32px"
                  ref="birthdayInput"
                  @keydown.enter.native="nextInput('phoneNumberInput')"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="性别：" prop="gender">
                <el-radio
                  disabled
                  v-model="ruleForm.gender"
                  class="el-radio-n"
                  label="男"
                  value="男"
                  border
                  size="small"
                  >男</el-radio
                >
                <el-radio
                  disabled
                  v-model="ruleForm.gender"
                  class="el-radio-n"
                  label="女"
                  value="女"
                  border
                  size="small"
                  >女</el-radio
                >
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="联系人姓名：" prop="contacts">
                <el-input
                  ref="contactsInput"
                  v-model="ruleForm.contacts"
                  clearable
                  disabled
                  style="width: 250px; height: 32px"
                  placeholder="请输入联系人姓名"
                  @keydown.enter.native="nextInput('contactsNumberInput')"
                  maxlength="12"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="联系人电话：" prop="contactsNumber">
                <el-input
                  ref="contactsNumberInput"
                  v-model="ruleForm.contactsNumber"
                  clearable
                  disabled
                  style="width: 250px; height: 32px"
                  placeholder="请输入联系人电话"
                  @keydown.enter.native="nextInput('addressInput')"
                  maxlength="12"
                />
              </el-form-item>
            </el-col>

            <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="责任医生：" prop="respDoctor">
                <el-input
                  disabled
                  v-model="ruleForm.respDoctor"
                  clearable
                  style="width: 250px; height: 32px"
                  ref="respDoctorInput"
                  @keydown.enter.native="nextInput('addressInput')"
                />
              </el-form-item>
            </el-col> -->
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="现住址：" prop="address">
                <el-input
                  v-model="ruleForm.address"
                  clearable
                  disabled
                  style="width: 82.5%; height: 32px"
                  ref="addressInput"
                  @keydown.enter.native="nextInput('heightInput')"
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="户籍地址：" prop="domicileAddress">
                <el-input
                  ref="domicileAddressInput"
                  v-model="ruleForm.domicileAddress"
                  clearable
                  disabled
                  style="width: 82.5%; height: 32px"
                  placeholder="请输入户籍地址"
                  @keydown.enter.native="nextInput('heightInput')"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 分类及症状 -->
        <el-form
          :model="ruleForm2"
          ref="ruleFormRef2"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules2"
        >
          <h3 class="ml20" id="part2">分类及症状</h3>
          <el-row :gutter="25">
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20 flex"
            >
              <div>
                <el-form-item label="人群分类：" prop="populationCategoryList">
                  <el-checkbox-group v-model="ruleForm2.populationCategoryList">
                    <el-checkbox label="高血压" value="高血压" />
                    <el-checkbox label="糖尿病" value="糖尿病" />
                    <el-checkbox label="老年人" value="老年人" disabled />
                    <el-checkbox label="其他" value="其他" />
                  </el-checkbox-group>
                </el-form-item>
              </div>
              <div v-show="ruleForm2.crowdInput">
                <el-form-item prop="populationCategoryOther">
                  <el-input
                    v-model="ruleForm2.populationCategoryOther"
                    clearable
                    style="width: 250px; height: 32px"
                    placeholder="请输入"
                  />
                </el-form-item>
              </div>
            </el-col>

            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="症状：" prop="symptomList">
                <el-checkbox-group
                  v-model="ruleForm2.symptomList"
                  @change="handleCheckboxChange"
                >
                  <el-checkbox label="无症状" value="无症状" />

                  <el-checkbox
                    label="头痛"
                    value="头痛"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="头晕"
                    value="头晕"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="心悸"
                    value="心悸"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="胸闷"
                    value="胸闷"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="胸痛"
                    value="胸痛"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="慢性咳嗽"
                    value="慢性咳嗽"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="咳痰"
                    value="咳痰"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="呼吸困难"
                    value="呼吸困难"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="多饮"
                    value="多饮"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="多尿"
                    value="多尿"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="体重下降"
                    value="体重下降"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="乏力"
                    value="乏力"
                    @click="handleCheckboxChange1"
                  />
                  <!-- 第二排 -->
                  <el-checkbox
                    label="关节肿痛"
                    value="关节肿痛"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="视力模糊"
                    value="视力模糊"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="手脚麻木"
                    value="手脚麻木"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="尿痛"
                    value="尿痛"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="尿急"
                    value="尿急"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="便秘"
                    value="便秘"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="腹泻"
                    value="腹泻"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="恶心呕吐"
                    value="恶心呕吐"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="眼花"
                    value="眼花"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="耳鸣"
                    value="耳鸣"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="乳房胀痛"
                    value="乳房胀痛"
                    @click="handleCheckboxChange1"
                  />
                  <el-checkbox
                    label="其他"
                    value="其他"
                    @click="handleCheckboxChange1"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              v-show="ruleForm2.symptomInput"
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
            >
              <el-form-item prop="symptomOther" label=" ">
                <el-input
                  v-model="ruleForm2.symptomOther"
                  clearable
                  placeholder="请输入"
                  style="height: 32px"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 一般状况 -->
        <el-form
          :model="ruleForm3"
          ref="ruleFormRef3"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules3"
        >
          <h3 class="ml20" id="part3">一般状况</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="身高：" prop="height">
                <!-- @blur="calcTargetHeight"
           :placeholder="ruleForm2.heightpl"
            @keydown.enter.native="NextInput('weightInput')" -->
                <el-input
                  clearable
                  v-model="ruleForm3.height"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  ref="heightInput"
                  @keydown.enter.native="nextInput('weightInput')"
                >
                  <template #append>CM</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="体重：" prop="weight">
                <el-input
                  clearable
                  v-model="ruleForm3.weight"
                  ref="weightInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('waistInput')"
                >
                  <template #append>KG</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="腰围：" prop="waist">
                <el-input
                  clearable
                  v-model="ruleForm3.waist"
                  ref="waistInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('temperatureInput')"
                >
                  <template #append>CM</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="体温：" prop="temperature">
                <el-input
                  clearable
                  v-model="ruleForm3.temperature"
                  ref="temperatureInput"
                  :maxlength="4"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('pulseInput')"
                >
                  <template #append>℃</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="脉率：" prop="pulse">
                <el-input
                  clearable
                  v-model="ruleForm3.pulse"
                  ref="pulseInput"
                  :maxlength="3"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('breathingRateInput')"
                >
                  <template #append>次/分钟</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="呼吸频率：" prop="breathingRate">
                <el-input
                  clearable
                  v-model="ruleForm3.breathingRate"
                  ref="breathingRateInput"
                  :maxlength="2"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('leftSystolicInput')"
                >
                  <template #append>次/分钟</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="左侧收缩压：" prop="leftSystolic">
                <el-input
                  clearable
                  v-model="ruleForm3.leftSystolic"
                  ref="leftSystolicInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('leftDiastolicInput')"
                >
                  <template #append>mmHg</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="左侧舒张压：" prop="leftDiastolic">
                <el-input
                  clearable
                  v-model="ruleForm3.leftDiastolic"
                  ref="leftDiastolicInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('rightSystolicInput')"
                >
                  <template #append>mmHg</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="右侧收缩压：" prop="rightSystolic">
                <el-input
                  clearable
                  v-model="ruleForm3.rightSystolic"
                  ref="rightSystolicInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('rightDiastolicInput')"
                >
                  <template #append>mmHg</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="右侧舒张压：" prop="rightDiastolic">
                <el-input
                  clearable
                  v-model="ruleForm3.rightDiastolic"
                  ref="rightDiastolicInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('randomGlucoseInput')"
                >
                  <template #append>mmHg</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="随机血糖：" prop="randomGlucose">
                <el-input
                  clearable
                  v-model="ruleForm3.randomGlucose"
                  placeholder="请输入随机血糖"
                  ref="randomGlucoseInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('fastingBloodGlucoseInput')"
                >
                  <template #append>mmol/L</template>
                </el-input>

                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="空腹血糖：" prop="fastingBloodGlucose">
                <el-input
                  clearable
                  v-model="ruleForm3.fastingBloodGlucose"
                  ref="fastingBloodGlucoseInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  placeholder="请输入空腹血糖"
                  @keydown.enter.native="nextInput('weeklySportsInput')"
                >
                  <template #append>mmol/L</template>
                </el-input>
              </el-form-item>
            </el-col>

            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm2.populationCategoryList.includes('老年人')"
            >
              <el-form-item label="健康状态自我评估：" prop="healthSelfRating">
                <el-radio-group v-model="ruleForm3.healthSelfRating">
                  <el-radio label="满意" name="healthSelfRating"></el-radio>
                  <el-radio
                    label="基本满意"
                    value="基本满意"
                    name="healthSelfRating"
                  ></el-radio>
                  <el-radio
                    label="说不清楚"
                    value="说不清楚"
                    name="healthSelfRating"
                  ></el-radio>
                  <el-radio
                    label="不太满意"
                    value="不太满意"
                    name="healthSelfRating"
                  ></el-radio>
                  <el-radio
                    label="不满意"
                    value="不满意"
                    name="healthSelfRating"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm2.populationCategoryList.includes('老年人')"
            >
              <el-form-item label="认知功能：" prop="cognition">
                <el-radio
                  v-model="ruleForm3.cognition"
                  class="el-radio-n"
                  label="粗筛阳性"
                  value="粗筛阳性"
                  border
                  size="small"
                  >粗筛阳性</el-radio
                >
                <el-radio
                  v-model="ruleForm3.cognition"
                  class="el-radio-n"
                  label="粗筛阴性"
                  value="粗筛阴性"
                  border
                  size="small"
                  >粗筛阴性</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm2.populationCategoryList.includes('老年人')"
            >
              <el-form-item
                label="生活自理能力评估："
                prop="elderlySelfCareScore"
              >
                <el-radio-group
                  v-model="ruleForm3.elderlySelfCareScore"
                  disabled
                >
                  <el-radio
                    label="可自理（0-3分）"
                    value="可自理（0-3分）"
                    name="elderlySelfCareScore"
                  ></el-radio>
                  <el-radio
                    label="轻度依赖（4-8分）"
                    value="轻度依赖（4-8分）"
                    name="elderlySelfCareScore"
                  ></el-radio>
                  <el-radio
                    label="中度依赖（9-18分）"
                    value="中度依赖（9-18分）"
                    name="elderlySelfCareScore"
                  ></el-radio>
                  <el-radio
                    label="不能自理（≥19分）"
                    value="不能自理（≥19分）"
                    name="elderlySelfCareScore"
                  ></el-radio>
                </el-radio-group>
                <el-button
                  style="margin-left: 10px"
                  type="primary"
                  native-type="button"
                  @click="openOld"
                >
                  老年人生活自理能力检查表
                </el-button>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 生活方式 -->
        <el-form
          :model="ruleForm4"
          ref="ruleFormRef4"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules4"
        >
          <h3 class="ml20" id="part4">生活方式</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="每周运动次数：" prop="weeklyExercises">
                <el-input
                  v-model="ruleForm4.weeklyExercises"
                  clearable
                  ref="weeklySportsInput"
                  :maxlength="2"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native.prevent="
                    nextInput('weeklySportsTimeInput')
                  "
                >
                  <template #append>次/周</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.durationShow"
            >
              <el-form-item label="每次运动时间：" prop="exerciseTime">
                <el-input
                  clearable
                  v-model="ruleForm4.exerciseTime"
                  ref="weeklySportsTimeInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('habitTimeInput')"
                >
                  <template #append>分钟</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.durationShow"
            >
              <el-form-item label="坚持运动时间：" prop="exerciseYears">
                <el-input
                  clearable
                  v-model="ruleForm4.exerciseYears"
                  ref="habitTimeInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                  @keydown.enter.native="nextInput('exerciseTypeInpunt')"
                >
                  <template #append>年</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>

            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.durationShow"
            >
              <el-form-item label="运动方式：" prop="exerciseType">
                <el-input
                  clearable
                  v-model="ruleForm4.exerciseType"
                  ref="exerciseTypeInpunt"
                  :maxlength="30"
                  style="width: 80%; height: 32px"
                >
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="饮食习惯：" prop="dietPartOne">
                <!-- <el-checkbox-group v-model="ruleForm4.dietPartTwo">
                  <el-checkbox label="荤素均衡" value="荤素均衡" />
                  <el-checkbox label="荤食为主" value="荤食为主" />
                  <el-checkbox label="素食为主" value="素食为主" />
                  <el-checkbox label="嗜盐" value="嗜盐" />
                  <el-checkbox label="嗜油" value="嗜油" />
                  <el-checkbox label="嗜糖" value="嗜糖" />
                </el-checkbox-group> -->
                <el-radio-group
                  v-model="ruleForm4.dietPartOne"
                  style="margin-right: 20px"
                >
                  <el-radio label="荤素均衡" value="荤素均衡" />
                  <el-radio label="荤食为主" value="荤食为主" />
                  <el-radio label="素食为主" value="素食为主" />
                </el-radio-group>
                <el-checkbox-group v-model="ruleForm4.dietPartTwo">
                  <el-checkbox label="嗜盐" value="嗜盐" />
                  <el-checkbox label="嗜油" value="嗜油" />
                  <el-checkbox label="嗜糖" value="嗜糖" />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="吸烟情况：" prop="smoking">
                <el-radio-group v-model="ruleForm4.smoking">
                  <el-radio
                    label="从不吸烟"
                    value="从不吸烟"
                    name="smoking"
                  ></el-radio>
                  <el-radio
                    label="已戒烟"
                    value="已戒烟"
                    name="smoking"
                  ></el-radio>
                  <el-radio label="吸烟" value="吸烟" name="smoking"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="this.ruleForm4.smoking == '吸烟'"
            >
              <el-form-item label="日吸烟量：" prop="dailySmoke">
                <el-input
                  clearable
                  v-model="ruleForm4.dailySmoke"
                  placeholder="请输入日吸烟量"
                  ref="dailySmokeInput"
                  :maxlength="3"
                  style="width: 80%; height: 32px"
                >
                  <template #append>支</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="
                this.ruleForm4.smoking == '吸烟' ||
                this.ruleForm4.smoking == '已戒烟'
              "
            >
              <el-form-item label="开始吸烟年龄：" prop="startSmokingAge">
                <el-input
                  clearable
                  v-model="ruleForm4.startSmokingAge"
                  placeholder="请输入开始吸烟年龄"
                  ref="startSmokeInput"
                  :maxlength="3"
                  style="width: 80%; height: 32px"
                >
                  <template #append>岁</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="this.ruleForm4.smoking == '已戒烟'"
            >
              <el-form-item label="戒烟年龄：" prop="quitSmokingAge">
                <el-input
                  clearable
                  v-model="ruleForm4.quitSmokingAge"
                  placeholder="请输入戒烟年龄"
                  ref="quitSmokeInput"
                  :maxlength="3"
                  style="width: 80%; height: 32px"
                >
                  <template #append>岁</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="饮酒频率：" prop="drinkingFrequency">
                <el-radio-group v-model="ruleForm4.drinkingFrequency">
                  <el-radio
                    label="从不"
                    value="从不"
                    name="drinkingFrequency"
                  ></el-radio>
                  <el-radio
                    label="偶尔"
                    value="偶尔"
                    name="drinkingFrequency"
                  ></el-radio>
                  <el-radio
                    label="经常"
                    value="经常"
                    name="drinkingFrequency"
                  ></el-radio>
                  <el-radio
                    label="每天"
                    value="每天"
                    name="drinkingFrequency"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="日饮酒量：" prop="dailyDrinkAmount">
                <el-input
                  clearable
                  v-model="ruleForm4.dailyDrinkAmount"
                  placeholder="请输入日饮酒量"
                  ref="dailyDrinkInput"
                  :maxlength="2"
                  style="width: 80%; height: 32px"
                >
                  <template #append>两</template>
                </el-input>
                <!-- <span v-show="ruleForm2.heightShow" style="color: #ff0000">{{
                ruleForm2.heightmsg
              }}</span> -->
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="近一年是否曾醉酒：" prop="drunkInPastYear">
                <el-radio
                  v-model="ruleForm4.drunkInPastYear"
                  class="el-radio-n"
                  label="是"
                  value="是"
                  border
                  size="small"
                  >是</el-radio
                >
                <el-radio
                  v-model="ruleForm4.drunkInPastYear"
                  class="el-radio-n"
                  label="否"
                  value="否"
                  border
                  size="small"
                  >否</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="开始饮酒年龄：" prop="startDrinkingAge">
                <el-input
                  clearable
                  v-model="ruleForm4.startDrinkingAge"
                  placeholder="请输入开始饮酒年龄"
                  ref="startDrinkInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                >
                  <template #append>岁</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="是否戒酒：" prop="quitDrinking">
                <el-radio
                  v-model="ruleForm4.quitDrinking"
                  class="el-radio-n"
                  label="是"
                  value="是"
                  border
                  size="small"
                  >是</el-radio
                >
                <el-radio
                  v-model="ruleForm4.quitDrinking"
                  class="el-radio-n"
                  label="否"
                  value="否"
                  border
                  size="small"
                  >否</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="戒酒年龄：" prop="quitDrinkingAge">
                <el-input
                  clearable
                  v-model="ruleForm4.quitDrinkingAge"
                  placeholder="请输入戒酒年龄"
                  ref="quitDrinkInput"
                  :maxlength="3"
                  style="width: 80%; height: 32px"
                >
                  <template #append>岁</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm4.drinkingFrequency !== '从不'"
            >
              <el-form-item label="饮酒种类：" prop="drinkTypeList">
                <el-checkbox-group v-model="ruleForm4.drinkTypeList">
                  <el-checkbox label="白酒" value="白酒" />
                  <el-checkbox label="啤酒" value="啤酒" />
                  <el-checkbox label="红酒" value="红酒" />
                  <el-checkbox label="黄酒" value="黄酒" />
                  <el-checkbox label="其他" value="其他" />
                </el-checkbox-group>
                <el-input
                  v-if="ruleForm4.drinkTypeList.includes('其他')"
                  clearable
                  v-model="ruleForm4.drinkTypeListOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="职业危害因素：" prop="jobHazards">
                <!-- <el-radio
                  v-model="ruleForm4.jobHazards"
                  class="el-radio-n"
                  label="有"
                  value="有"
                  border
                  size="small"
                  style="margin-right: 45px"
                  >有</el-radio
                >
                <el-radio
                  v-model="ruleForm4.jobHazards"
                  class="el-radio-n"
                  label="无"
                  value="无"
                  border
                  size="small"
                  >无</el-radio
                > -->
                <el-radio-group v-model="ruleForm4.jobHazards">
                  <el-radio label="无" value="无" name="jobHazards"></el-radio>
                  <el-radio
                    label="化学物质"
                    value="化学物质"
                    name="jobHazards"
                  ></el-radio>
                  <el-radio
                    label="物理因素"
                    value="物理因素"
                    name="jobHazards"
                  ></el-radio>
                  <el-radio
                    label="放射物质"
                    value="放射物质"
                    name="jobHazards"
                  ></el-radio>
                  <el-radio
                    label="粉尘"
                    value="粉尘"
                    name="jobHazards"
                  ></el-radio>
                  <el-radio
                    label="其他"
                    value="其他"
                    name="jobHazards"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards !== '无'"
            >
              <el-form-item label="具体职业：" prop="specificJob">
                <el-input
                  clearable
                  v-model="ruleForm4.specificJob"
                  placeholder="请输入具体职业"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards !== '无'"
            >
              <el-form-item label="从业时间：" prop="yearsOfService">
                <el-input
                  clearable
                  v-model="ruleForm4.yearsOfService"
                  placeholder="请输入从业时间"
                  ref="yearsOfServiceInput"
                  :maxlength="5"
                  style="width: 80%; height: 32px"
                >
                  <template #append>年</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '化学物质'"
            >
              <el-form-item label="化学物质：" prop="otherHazards">
                <el-input
                  clearable
                  v-model="ruleForm4.otherHazards"
                  placeholder="请输入化学物质"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '化学物质'"
            >
              <el-form-item label="防护措施：" prop="otherProtection">
                <el-radio-group
                  v-model="ruleForm4.otherProtection"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherProtection"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherProtection"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm4.otherProtection == '有'"
                  style="height: 32px; width: 135px"
                  v-model="ruleForm4.otherProtectionOther"
                  placeholder="请输入防护措施"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '物理因素'"
            >
              <el-form-item label="物理因素：" prop="otherHazards">
                <el-input
                  clearable
                  v-model="ruleForm4.otherHazards"
                  placeholder="请输入物理因素"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '物理因素'"
            >
              <el-form-item label="防护措施：" prop="otherProtection">
                <el-radio-group
                  v-model="ruleForm4.otherProtection"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherProtection"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherProtection"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm4.otherProtection == '有'"
                  clearable
                  style="height: 32px; width: 135px"
                  v-model="ruleForm4.otherProtectionOther"
                  placeholder="请输入防护措施"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '放射物质'"
            >
              <el-form-item label="放射物质：" prop="otherHazards">
                <el-input
                  clearable
                  v-model="ruleForm4.otherHazards"
                  placeholder="请输入放射物质"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '放射物质'"
            >
              <el-form-item label="防护措施：" prop="otherProtection">
                <el-radio-group
                  v-model="ruleForm4.otherProtection"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherProtection"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherProtection"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm4.otherProtection == '有'"
                  clearable
                  style="height: 32px; width: 135px"
                  v-model="ruleForm4.otherProtectionOther"
                  placeholder="请输入防护措施"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '粉尘'"
            >
              <el-form-item label="粉尘：" prop="otherHazards">
                <el-input
                  clearable
                  v-model="ruleForm4.otherHazards"
                  placeholder="请输入粉尘"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '粉尘'"
            >
              <el-form-item label="防护措施：" prop="otherProtection">
                <el-radio-group
                  v-model="ruleForm4.otherProtection"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherProtection"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherProtection"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm4.otherProtection == '有'"
                  clearable
                  style="height: 32px; width: 135px"
                  v-model="ruleForm4.otherProtectionOther"
                  placeholder="请输入防护措施"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '其他'"
            >
              <el-form-item label="其他：" prop="otherHazards">
                <el-input
                  clearable
                  v-model="ruleForm4.otherHazards"
                  placeholder="请输入其他"
                  ref=" "
                  :maxlength="20"
                  style="width: 80%; height: 32px"
                >
                </el-input>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20"
              v-if="ruleForm4.jobHazards == '其他'"
            >
              <el-form-item label="防护措施：" prop="otherProtection">
                <el-radio-group
                  v-model="ruleForm4.otherProtection"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherProtection"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherProtection"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm4.otherProtection == '有'"
                  clearable
                  style="height: 32px; width: 135px"
                  v-model="ruleForm4.otherProtectionOther"
                  placeholder="请输入防护措施"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 脏器功能 -->
        <el-form
          :model="ruleForm5"
          ref="ruleFormRef5"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules5"
        >
          <h3 class="ml20" id="part5">脏器功能</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="口唇：" prop="lips">
                <el-radio-group v-model="ruleForm5.lips">
                  <el-radio label="红润" value="红润" name="lips"></el-radio>
                  <el-radio label="苍白" value="苍白" name="lips"></el-radio>
                  <el-radio label="发绀" value="发绀" name="lips"></el-radio>
                  <el-radio label="皲裂" value="皲裂" name="lips"></el-radio>
                  <el-radio label="疱疹" value="疱疹" name="lips"></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="咽部：" prop="throatList">
                <el-checkbox-group v-model="ruleForm5.throatList">
                  <el-checkbox
                    label="无充血"
                    value="无充血"
                    @change="changePharynx"
                  />
                  <el-checkbox
                    label="充血"
                    value="充血"
                    @change="changePharynx2"
                  />
                  <el-checkbox
                    label="淋巴滤泡增生"
                    value="淋巴滤泡增生"
                    @change="changePharynx2"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="齿列：" prop="teethAlignmentList">
                <el-checkbox-group v-model="ruleForm5.teethAlignmentList">
                  <el-checkbox
                    label="正常"
                    value="正常"
                    @change="changeDentalHealth"
                  />
                  <el-checkbox
                    label="缺齿"
                    value="缺齿"
                    @change="changeDentalHealth2"
                  />
                  <el-checkbox
                    label="龋齿"
                    value="龋齿"
                    @change="changeDentalHealth2"
                  />
                  <el-checkbox
                    label="义齿(假牙)"
                    value="义齿(假牙)"
                    @change="changeDentalHealth2"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="
                !ruleForm5.teethAlignmentList.includes('正常') &&
                ruleForm5.teethAlignmentList.length > 0
              "
            >
              <el-form-item label=" ">
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <div class="title_box">左上</div>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <div class="title_box">左下</div>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <div class="title_box">右上</div>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <div class="title_box">右下</div>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm5.teethAlignmentList.includes('缺齿')"
            >
              <el-form-item label="缺齿：">
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.missing_teeth_top_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="missing_teeth_top_left"
                    @keydown.enter.native="
                      nextInput('missing_teeth_bottom_left')
                    "
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.missing_teeth_bottom_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="missing_teeth_bottom_left"
                    @keydown.enter.native="nextInput('missing_teeth_top_right')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.missing_teeth_top_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="missing_teeth_top_right"
                    @keydown.enter.native="
                      nextInput('missing_teeth_bottom_right')
                    "
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.missing_teeth_bottom_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="missing_teeth_bottom_right"
                    @keydown.enter.native="nextInput('missing_teeth')"
                  ></el-input>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm5.teethAlignmentList.includes('龋齿')"
            >
              <el-form-item label="龋齿：">
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.cavities_top_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="cavities_top_left"
                    @keydown.enter.native="nextInput('cavities_bottom_left')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.cavities_bottom_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="cavities_bottom_left"
                    @keydown.enter.native="nextInput('cavities_top_right')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.cavities_top_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="cavities_top_right"
                    @keydown.enter.native="nextInput('cavities_bottom_right')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.cavities_bottom_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="cavities_bottom_right"
                    @keydown.enter.native="nextInput('cavities')"
                  ></el-input>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm5.teethAlignmentList.includes('义齿(假牙)')"
            >
              <el-form-item label="义齿：">
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.dentures_top_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="dentures_top_left"
                    @keydown.enter.native="nextInput('dentures_bottom_left')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.dentures_bottom_left"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="dentures_bottom_left"
                    @keydown.enter.native="nextInput('dentures_top_right')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.dentures_top_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="dentures_top_right"
                    @keydown.enter.native="nextInput('dentures_bottom_right')"
                  ></el-input>
                </el-col>
                <el-col :xs="5" :sm="5" :md="5" :lg="5" :xl="5">
                  <el-input
                    clearable
                    v-model="ruleForm5.dentures_bottom_right"
                    placeholder="请输入"
                    style="height: 32px; width: 152px"
                    ref="dentures_bottom_right"
                    @keydown.enter.native="nextInput('leftEyeInput')"
                  ></el-input>
                </el-col>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              style="display: flex"
            >
              <div>
                <el-form-item label="视力：" prop="vision">
                  <el-radio-group v-model="ruleForm5.vision">
                    <el-radio
                      label="裸眼视力"
                      value="裸眼视力"
                      name="vision"
                      @change="visionChange"
                    ></el-radio>
                    <el-radio
                      label="矫正视力"
                      value="矫正视力"
                      name="vision"
                      @change="visionChange2"
                    ></el-radio>
                  </el-radio-group>
                </el-form-item>
              </div>
              <el-form-item
                prop="leftEye"
                style="margin-left: 20px"
                v-if="ruleForm5.vision == '裸眼视力'"
              >
                <el-input
                  ref="leftEyeInput"
                  clearable
                  v-model="ruleForm5.leftEye"
                  placeholder="请输入左侧裸眼视力"
                  style="width: 160px; height: 32px; margin-right: 20px"
                  @input="debouncedleftEye"
                  @keydown.enter.native="nextInput('rightEyeInput')"
                ></el-input>
              </el-form-item>
              <el-form-item
                prop="rightEye"
                style="margin-left: 20px"
                v-if="ruleForm5.vision == '裸眼视力'"
              >
                <el-input
                  ref="rightEyeInput"
                  clearable
                  v-model="ruleForm5.rightEye"
                  placeholder="请输入右侧裸眼视力"
                  style="width: 160px; height: 32px"
                  @input="debouncedrightEye"
                ></el-input>
              </el-form-item>

              <el-form-item
                prop="leftjzEye"
                style="margin-left: 20px"
                v-if="ruleForm5.vision == '矫正视力'"
              >
                <el-input
                  ref="leftjzEyeInput"
                  clearable
                  v-model="ruleForm5.leftjzEye"
                  placeholder="请输入左侧矫正视力"
                  style="width: 160px; height: 32px; margin-right: 20px"
                  @keydown.enter.native="nextInput('rightjzEyeInput')"
                   @input="debouncedleftjzEye"
                ></el-input>
              </el-form-item>
              <el-form-item
                prop="rightjzEye"
                style="margin-left: 20px"
                v-if="ruleForm5.vision == '矫正视力'"
              >
                <el-input
                  ref="rightjzEyeInput"
                  clearable
                  v-model="ruleForm5.rightjzEye"
                  placeholder="请输入右侧矫正视力"
                  style="width: 160px; height: 32px"
                    @input="debouncedrightjzEye"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="听力：" prop="hearing">
                <el-radio-group v-model="ruleForm5.hearing">
                  <el-radio label="听见" value="听见" name="hearing"></el-radio>
                  <el-radio
                    label="听不清或无法听见"
                    value="听不清或无法听见"
                    name="hearing"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="运动功能：" prop="motorFunction">
                <el-radio-group v-model="ruleForm5.motorFunction">
                  <el-radio
                    label="可顺利完成"
                    value="可顺利完成"
                    name="motorFunction"
                  ></el-radio>
                  <el-radio
                    label="无法独立完成其中任何一个动作"
                    value="无法独立完成其中任何一个动作"
                    name="motorFunction"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 查体 -->
        <el-form
          :model="ruleForm9"
          ref="ruleFormRef9"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules9"
        >
          <h3 class="ml20" id="part9">查体</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="皮肤：" prop="skin">
                <el-radio-group v-model="ruleForm9.skin">
                  <el-radio label="正常" value="正常" name="skin"></el-radio>
                  <el-radio label="潮红" value="潮红" name="skin"></el-radio>
                  <el-radio label="发绀" value="发绀" name="skin"></el-radio>
                  <el-radio label="黄染" value="黄染" name="skin"></el-radio>
                  <el-radio
                    label="色素沉着"
                    value="色素沉着"
                    name="skin"
                  ></el-radio>
                  <el-radio label="其他" value="其他" name="skin"></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.skin == '其他'"
                  clearable
                  v-model="ruleForm9.skinOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="巩膜：" prop="sclera">
                <el-radio-group v-model="ruleForm9.sclera">
                  <el-radio label="正常" value="正常" name="sclera"></el-radio>
                  <el-radio label="黄染" value="黄染" name="sclera"></el-radio>
                  <el-radio label="充血" value="充血" name="sclera"></el-radio>
                  <el-radio label="其他" value="其他" name="sclera"></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.sclera == '其他'"
                  clearable
                  v-model="ruleForm9.scleraOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="淋巴结：" prop="lymphNodesList">
                <!-- <el-radio-group v-model="ruleForm9.lymphNodesList">
                  <el-radio label="正常"  value="正常" name="lymphNodesList"></el-radio>
                  <el-radio label="锁骨上"  value="锁骨上" name="lymphNodesList"></el-radio>
                  <el-radio label="腋窝" value="腋窝" name="lymphNodesList"></el-radio>
                  <el-radio label="其他"  value="其他" name="lymphNodesList"></el-radio>
                </el-radio-group> -->
                <el-checkbox-group v-model="ruleForm9.lymphNodesList">
                  <el-checkbox
                    label="未触及"
                    value="未触及"
                    @change="changelymp"
                  />
                  <el-checkbox
                    label="锁骨上"
                    value="锁骨上"
                    @change="changelymp2"
                  />
                  <el-checkbox
                    label="腋窝"
                    value="腋窝"
                    @change="changelymp2"
                  />
                  <el-checkbox
                    label="其他"
                    value="其他"
                    @change="changelymp2"
                  />
                </el-checkbox-group>
                <el-input
                  v-if="ruleForm9.lymphNodesList.includes('其他')"
                  clearable
                  v-model="ruleForm9.lymphNodesOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="肺部桶状胸：" prop="barrelChest">
                <el-radio
                  v-model="ruleForm9.barrelChest"
                  class="el-radio-n"
                  label="是"
                  value="是"
                  border
                  size="small"
                  >是</el-radio
                >
                <el-radio
                  v-model="ruleForm9.barrelChest"
                  class="el-radio-n"
                  label="否"
                  value="否"
                  border
                  size="small"
                  >否</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="肺部呼吸音：" prop="breathSounds">
                <el-radio-group v-model="ruleForm9.breathSounds">
                  <el-radio
                    label="正常"
                    value="正常"
                    name="breathSounds"
                  ></el-radio>
                  <el-radio
                    label="异常"
                    value="异常"
                    name="breathSounds"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.breathSounds == '异常'"
                  clearable
                  v-model="ruleForm9.breathSoundsOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="肺部啰音：" prop="ralesList">
                <!-- <el-radio-group v-model="ruleForm9.ralesList">
                  <el-radio label="无" value="无" name="ralesList"></el-radio>
                  <el-radio label="干啰音"  value="干啰音" name="ralesList"></el-radio>
                  <el-radio label="湿啰音" value="湿啰音"  name="ralesList"></el-radio>
                  <el-radio label="其他" value="其他" name="ralesList"></el-radio>
                </el-radio-group> -->
                <el-checkbox-group v-model="ruleForm9.ralesList">
                  <el-checkbox
                    label="无"
                    value="无"
                    style="margin-right: 50px"
                    @change="changeLung"
                  />
                  <el-checkbox
                    label="干啰音"
                    value="干啰音"
                    style="margin-right: 50px"
                    @change="changeLung2"
                  />
                  <el-checkbox
                    label="湿啰音"
                    value="湿啰音"
                    style="margin-right: 50px"
                    @change="changeLung2"
                  />
                  <el-checkbox
                    label="其他"
                    value="其他"
                    @change="changeLung2"
                  />
                </el-checkbox-group>
                <el-input
                  v-if="ruleForm9.ralesList.includes('其他')"
                  clearable
                  v-model="ruleForm9.ralesListOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="心律：" prop="heartRhythm">
                <el-radio-group v-model="ruleForm9.heartRhythm">
                  <el-radio label="齐" value="齐" name="heartRhythm"></el-radio>
                  <el-radio
                    label="不齐"
                    value="不齐"
                    name="heartRhythm"
                  ></el-radio>
                  <el-radio
                    label="绝对不齐"
                    value="绝对不齐"
                    name="heartRhythm"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="心率：" prop="heartRate">
                <el-input
                  clearable
                  v-model="ruleForm9.heartRate"
                  placeholder="请输入心率"
                  ref=""
                  :maxlength="5"
                  style="width: 250px; height: 32px"
                >
                  <template #append>次/分钟</template>
                </el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="心脏杂音：" prop="heartMurmur">
                <el-radio-group v-model="ruleForm9.heartMurmur">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="heartMurmur"
                  ></el-radio>
                  <el-radio label="有" value="有" name="heartMurmur"></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.heartMurmur == '有'"
                  clearable
                  v-model="ruleForm9.heartMurmurOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="腹部压痛：" prop="abdominalTenderness">
                <el-radio-group v-model="ruleForm9.abdominalTenderness">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="abdominalTenderness"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="abdominalTenderness"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.abdominalTenderness == '有'"
                  clearable
                  v-model="ruleForm9.abdominalTendernessOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="腹部包块：" prop="abdominalMass">
                <el-radio-group v-model="ruleForm9.abdominalMass">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="abdominalMass"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="abdominalMass"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.abdominalMass == '有'"
                  clearable
                  v-model="ruleForm9.abdominalMassOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="腹部肝大：" prop="hepatomegaly">
                <el-radio-group v-model="ruleForm9.hepatomegaly">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="hepatomegaly"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="hepatomegaly"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.hepatomegaly == '有'"
                  clearable
                  v-model="ruleForm9.hepatomegalyOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="腹部脾大：" prop="splenomegaly">
                <el-radio-group v-model="ruleForm9.splenomegaly">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="splenomegaly"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="splenomegaly"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.splenomegaly == '有'"
                  clearable
                  v-model="ruleForm9.splenomegalyOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="移动性浊音：" prop="shiftingDullness">
                <el-radio-group v-model="ruleForm9.shiftingDullness">
                  <el-radio
                    style="margin-right: 78px"
                    label="无"
                    value="无"
                    name="shiftingDullness"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="shiftingDullness"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm9.shiftingDullness == '有'"
                  clearable
                  v-model="ruleForm9.shiftingDullnessOther"
                  placeholder="请输入"
                  :maxlength="30"
                  style="height: 32px; width: 180px; margin-left: 15px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="下肢水肿：" prop="legEdema">
                <el-radio-group v-model="ruleForm9.legEdema">
                  <el-radio
                    style="margin-right: 70px"
                    label="无"
                    value="无"
                    name="legEdema"
                  ></el-radio>
                  <el-radio
                    style="margin-right: 70px"
                    label="单侧"
                    value="单侧"
                    name="legEdema"
                  ></el-radio>
                  <el-radio
                    style="margin-right: 70px"
                    label="双侧不对称"
                    value="双侧不对称"
                    name="legEdema"
                  ></el-radio>
                  <el-radio
                    style="margin-right: 70px"
                    label="双侧对称"
                    value="双侧对称"
                    name="legEdema"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="足背动脉搏动：" prop="dorsalPulsePartList">
                <el-checkbox-group v-model="ruleForm9.dorsalPulsePartList">
                  <el-checkbox
                    label="未触及"
                    value="未触及"
                    style="margin-right: 50px"
                    @change="changeHeart"
                  />
                  <el-checkbox
                    label="触及双侧对称"
                    value="触及双侧对称"
                    style="margin-right: 50px"
                    @change="changeHeart2"
                  />
                  <el-checkbox
                    label="触及左侧减弱或消失"
                    value="触及左侧减弱或消失"
                    style="margin-right: 50px"
                    @change="changeHeart3"
                  />
                  <el-checkbox
                    label="触及右侧减弱或消失"
                    value="触及右侧减弱或消失"
                    @change="changeHeart3"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 现存主要健康问题 -->
        <el-form
          :model="ruleForm6"
          ref="ruleFormRef6"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules6"
        >
          <h3 class="ml20" id="part6">现存主要健康问题</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item
                label="脑血管疾病："
                prop="cerebrovascularDiseaseList"
              >
                <el-checkbox-group
                  v-model="ruleForm6.cerebrovascularDiseaseList"
                >
                  <el-checkbox
                    style="margin-right: 42px"
                    @change="changeCereb"
                    label="无"
                    value="无"
                  />
                  <el-checkbox
                    style="margin-right: 42px"
                    @change="changeCereb1"
                    label="缺血性卒中"
                    value="缺血性卒中"
                  />
                  <el-checkbox
                    style="margin-right: 42px"
                    @change="changeCereb1"
                    label="脑出血"
                    value="脑出血"
                  />
                  <el-checkbox
                    style="margin-right: 42px"
                    @change="changeCereb1"
                    label="蛛网膜下腔出血"
                    value="蛛网膜下腔出血"
                  />
                  <el-checkbox
                    @change="changeCereb1"
                    label="短暂性脑缺血发作"
                    value="短暂性脑缺血发作"
                    style="margin-right: 15px"
                  />
                  <el-checkbox
                    @change="changeCereb1"
                    label="其他"
                    value="其他"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm6.cerebrovascularDiseaseList.includes('其他')"
            >
              <el-form-item label=" " prop="cerebrovascularDiseaseOther">
                <el-input
                  v-model="ruleForm6.cerebrovascularDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 700px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="肾脏疾病：" prop="kidneyDiseaseList">
                <el-checkbox-group v-model="ruleForm6.kidneyDiseaseList">
                  <el-checkbox
                    @change="changeRenal"
                    style="margin-right: 51px"
                    label="无"
                    value="无"
                  />
                  <el-checkbox
                    @change="changeRenal1"
                    style="margin-right: 51px"
                    label="糖尿病肾病"
                    value="糖尿病肾病"
                  />
                  <el-checkbox
                    @change="changeRenal1"
                    style="margin-right: 51px"
                    label="肾功能衰竭"
                    value="肾功能衰竭"
                  />
                  <el-checkbox
                    @change="changeRenal1"
                    style="margin-right: 51px"
                    label="急性肾炎"
                    value="急性肾炎"
                  />
                  <el-checkbox
                    @change="changeRenal1"
                    style="margin-right: 51px"
                    label="慢性肾炎"
                    value="慢性肾炎"
                  />
                  <el-checkbox
                    @change="changeRenal1"
                    style="margin-right: 51px"
                    label="其他"
                    value="其他"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm6.kidneyDiseaseList.includes('其他')"
            >
              <el-form-item label=" " prop="kidneyDiseaseOther">
                <el-input
                  v-model="ruleForm6.kidneyDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 700px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="心脏疾病：" prop="heartDiseaseList">
                <el-checkbox-group v-model="ruleForm6.heartDiseaseList">
                  <el-checkbox @change="changeCardiac" label="无" value="无" />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="心肌梗死"
                    value="心肌梗死"
                  />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="心绞痛"
                    value="心绞痛"
                  />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="冠状动脉血管重建"
                    value="冠状动脉血管重建"
                  />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="充血性心力衰竭"
                    value="充血性心力衰竭"
                  />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="心前区疼痛"
                    value="心前区疼痛"
                  />
                  <el-checkbox
                    @change="changeCardiac1"
                    label="其他"
                    value="其他"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm6.heartDiseaseList.includes('其他')"
            >
              <el-form-item label=" " prop="heartDiseaseOther">
                <el-input
                  v-model="ruleForm6.heartDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 700px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="血管疾病：" prop="vascularDiseaseList">
                <el-checkbox-group v-model="ruleForm6.vascularDiseaseList">
                  <el-checkbox
                    @change="changeVascular"
                    style="margin-right: 71px"
                    label="无"
                    value="无"
                  />
                  <el-checkbox
                    @change="changeVascular1"
                    style="margin-right: 71px"
                    label="夹层动脉瘤"
                    value="夹层动脉瘤"
                  />
                  <el-checkbox
                    @change="changeVascular1"
                    style="margin-right: 71px"
                    label="动脉闭塞性疾病"
                    value="动脉闭塞性疾病"
                  />
                  <el-checkbox
                    @change="changeVascular1"
                    label="其他"
                    value="其他"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm6.vascularDiseaseList.includes('其他')"
            >
              <el-form-item label=" " prop="vascularDiseaseOther">
                <el-input
                  v-model="ruleForm6.vascularDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 700px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="眼部疾病：" prop="eyeDiseaseList">
                <el-checkbox-group v-model="ruleForm6.eyeDiseaseList">
                  <el-checkbox
                    @change="changeEye"
                    style="margin-right: 34px"
                    label="无"
                    value="无"
                  />
                  <el-checkbox
                    style="margin-right: 34px"
                    @change="changeEye1"
                    label="视网膜出血或渗出"
                    value="视网膜出血或渗出"
                  />
                  <el-checkbox
                    @change="changeEye1"
                    style="margin-right: 34px"
                    label="视乳头水肿"
                    value="视乳头水肿"
                  />
                  <el-checkbox
                    @change="changeEye1"
                    style="margin-right: 34px"
                    label="白内障"
                    value="白内障"
                  />
                  <el-checkbox @change="changeEye1" label="其他" value="其他" />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20"
              v-if="ruleForm6.eyeDiseaseList.includes('其他')"
            >
              <el-form-item label=" " prop="eyeDiseaseOther">
                <el-input
                  v-model="ruleForm6.eyeDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 700px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="神经系统疾病：" prop="nervousSystemDisease">
                <el-radio-group
                  v-model="ruleForm6.nervousSystemDisease"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="nervousSystemDisease"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="nervousSystemDisease"
                  ></el-radio>
                </el-radio-group>

                <el-input
                  v-if="ruleForm6.nervousSystemDisease == '有'"
                  v-model="ruleForm6.nervousSystemDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 160px"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="其他系统疾病：" prop="otherSystemDisease">
                <el-radio-group
                  v-model="ruleForm6.otherSystemDisease"
                  style="margin-right: 15px"
                >
                  <el-radio
                    label="无"
                    value="无"
                    name="otherSystemDisease"
                  ></el-radio>
                  <el-radio
                    label="有"
                    value="有"
                    name="otherSystemDisease"
                  ></el-radio>
                </el-radio-group>
                <el-input
                  v-if="ruleForm6.otherSystemDisease == '有'"
                  v-model="ruleForm6.otherSystemDiseaseOther"
                  placeholder="请输入"
                  style="height: 32px; width: 160px"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 住院治疗情况 -->
        <el-form
          :model="ruleForm7"
          ref="ruleFormRef7"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules7"
        >
          <h3 class="ml20" id="part7">住院治疗情况</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="住院史：" prop="hospitalHistoryListStatus">
                <el-radio
                  v-model="ruleForm7.hospitalHistoryListStatus"
                  class="el-radio-n"
                  label="无"
                  value="无"
                  border
                  size="small"
                  @change="changeHospital2"
                  >无</el-radio
                >
                <el-radio
                  v-model="ruleForm7.hospitalHistoryListStatus"
                  class="el-radio-n"
                  label="有"
                  value="有"
                  border
                  size="small"
                  style="margin-right: 45px"
                  @change="changeHospital"
                  >有</el-radio
                >
              </el-form-item>
            </el-col>

            <el-row
              :gutter="25"
              style="
                padding-right: 12.5px;
                padding-left: 12.5px;
                margin-bottom: 20px;
              "
              v-if="ruleForm7.hospitalHistoryListStatus == '有'"
              v-for="(item, index) in ruleForm7.hospitalHistoryList"
              :key="item"
            >
              <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                <el-form-item
                  style="margin-left: 150px"
                  :prop="
                    `hospitalHistoryList.` + index + `.medicalInstitutionName`
                  "
                >
                  <el-input
                    clearable
                    style="height: 32px; width: 330px"
                    placeholder="请输入医疗机构名称"
                    v-model="item.medicalInstitutionName"
                    :maxlength="30"
                    ref="medicalInstitutionNameInput"
                    @keydown.enter.native="nextInput('reasonInput', index)"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                <el-form-item
                  label=""
                  :prop="`hospitalHistoryList.` + index + `.reason`"
                >
                  <el-input
                    clearable
                    v-model="item.reason"
                    style="height: 32px; width: 330px"
                    placeholder="请输入原因"
                    :maxlength="30"
                    ref="reasonInput"
                    @keydown.enter.native="
                      nextInput('admissionDateInput', index)
                    "
                  ></el-input>
                  <el-icon
                    v-if="index == 0"
                    class="iconBox"
                    @click.prevent="addHosp"
                    ><CirclePlusFilled
                  /></el-icon>
                  <el-icon
                    v-else
                    class="iconBox"
                    @click.prevent="moveHosp(item)"
                    ><RemoveFilled
                  /></el-icon>
                </el-form-item>
              </el-col>
              <el-col
                :xs="24"
                :sm="12"
                :md="12"
                :lg="12"
                :xl="12"
                class="mb20 flexBox"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  style="margin-left: 150px"
                  :prop="`hospitalHistoryList.` + index + `.admissionDate`"
                  :rules="[
                    {
                      required: false,
                      validator: validateAdmissionDate,
                      trigger: 'blur',
                    },
                  ]"
                >
                  <!-- v-model="item.admissionDate" -->
                  <el-input
                    clearable
                    v-model="item.admissionDate"
                    style="height: 32px; width: 180px"
                    placeholder="请输入入院日期"
                    :maxlength="10"
                    ref="admissionDateInput"
                    @keydown.enter.native="
                      nextInput('dischargeDateInput', index)
                    "
                  >
                    <template #append> / </template>
                  </el-input>
                </el-form-item>
                <el-form-item
                  label=""
                  :prop="`hospitalHistoryList.` + index + `.dischargeDate`"
                  :rules="[
                    {
                      required: false,
                      validator: validateOutDate,
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    clearable
                    v-model="item.dischargeDate"
                    style="height: 32px; width: 150px"
                    placeholder="请输入出院日期"
                    :maxlength="10"
                    ref="dischargeDateInput"
                    @keydown.enter.native="
                      nextInput('medicalRecordNumberInput', index)
                    "
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col
                :xs="24"
                :sm="12"
                :md="12"
                :lg="12"
                :xl="12"
                class="mb20"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  :prop="
                    `hospitalHistoryList.` + index + `.medicalRecordNumber`
                  "
                  :rules="[
                    {
                      required: false,
                      message: '请输入病案号',
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    clearable
                    v-model="item.medicalRecordNumber"
                    style="height: 32px; width: 330px"
                    placeholder="请输入病案号"
                    :maxlength="30"
                    ref="medicalRecordNumberInput"
                    @keydown.enter.native="
                      nextInput('medicalInstitutionNameInput', index + 1)
                    "
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item
                label="家庭病床史："
                prop="familyBedHistoryListStatus"
              >
                <el-radio
                  v-model="ruleForm7.familyBedHistoryListStatus"
                  class="el-radio-n"
                  label="无"
                  value="无"
                  border
                  size="small"
                  @change="changeHome2"
                  >无</el-radio
                >
                <el-radio
                  v-model="ruleForm7.familyBedHistoryListStatus"
                  class="el-radio-n"
                  label="有"
                  value="有"
                  border
                  size="small"
                  style="margin-right: 45px"
                  @change="changeHome"
                  >有</el-radio
                >
              </el-form-item>
            </el-col>
            <el-row
              :gutter="25"
              style="padding-right: 12.5px; padding-left: 12.5px"
              v-if="ruleForm7.familyBedHistoryListStatus == '有'"
              v-for="(item, index) in ruleForm7.familyBedHistoryList"
              :key="item"
            >
              <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                <el-form-item
                  style="margin-left: 150px"
                  :prop="
                    `familyBedHistoryList.` + index + `.medicalInstitutionName`
                  "
                >
                  <el-input
                    clearable
                    style="height: 32px; width: 330px"
                    placeholder="请输入医疗机构名称"
                    v-model="item.medicalInstitutionName"
                    :maxlength="30"
                    ref="medicalNameInput"
                    @keydown.enter.native="nextInput('reasonnameInput', index)"
                  ></el-input>
                </el-form-item>
              </el-col>
              <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
                <el-form-item
                  label=""
                  :prop="`familyBedHistoryList.` + index + `.reason`"
                >
                  <el-input
                    clearable
                    v-model="item.reason"
                    style="height: 32px; width: 330px"
                    placeholder="请输入原因"
                    :maxlength="30"
                    ref="reasonnameInput"
                    @keydown.enter.native="nextInput('bedDateInput', index)"
                  ></el-input>
                  <el-icon
                    v-if="index == 0"
                    class="iconBox"
                    @click.prevent="addHome"
                    ><CirclePlusFilled
                  /></el-icon>
                  <el-icon
                    v-else
                    class="iconBox"
                    @click.prevent="moveHome(item)"
                    ><RemoveFilled
                  /></el-icon>
                </el-form-item>
              </el-col>
              <el-col
                :xs="24"
                :sm="12"
                :md="12"
                :lg="12"
                :xl="12"
                class="mb20 flexBox"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  style="margin-left: 150px"
                  :prop="
                    `familyBedHistoryList.` + index + `.bedEstablishedDate`
                  "
                  :rules="[
                    {
                      required: false,
                      validator: validateAdmissionDate,
                      trigger: 'blur',
                    },
                  ]"
                >
                  <!-- v-model="item.admissionDate" -->
                  <el-input
                    clearable
                    v-model="item.bedEstablishedDate"
                    style="height: 32px; width: 180px"
                    placeholder="请输入建床日期"
                    :maxlength="10"
                    ref="bedDateInput"
                    @keydown.enter.native="
                      nextInput('bedRemovedDateInput', index)
                    "
                  >
                    <template #append> / </template>
                  </el-input>
                </el-form-item>
                <el-form-item
                  label=""
                  :prop="`familyBedHistoryList.` + index + `.bedRemovedDate`"
                  :rules="[
                    {
                      required: true,
                      validator: validateOutDate,
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    clearable
                    v-model="item.bedRemovedDate"
                    style="height: 32px; width: 150px"
                    placeholder="请输入撤床日期"
                    :maxlength="10"
                    ref="bedRemovedDateInput"
                    @keydown.enter.native="
                      nextInput('medicalRecordInput', index)
                    "
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col
                :xs="24"
                :sm="12"
                :md="12"
                :lg="12"
                :xl="12"
                class="mb20"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  :prop="
                    `familyBedHistoryList.` + index + `.medicalRecordNumber`
                  "
                >
                  <el-input
                    clearable
                    v-model="item.medicalRecordNumber"
                    style="height: 32px; width: 330px"
                    placeholder="请输入病案号"
                    :maxlength="30"
                    ref="medicalRecordInput"
                    @keydown.enter.native="
                      nextInput('medicalNameInput', index + 1)
                    "
                  ></el-input>
                </el-form-item>
              </el-col>
            </el-row>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 非免疫规划接种史 -->
        <el-form
          :model="ruleForm8"
          ref="ruleFormRef8"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules8"
        >
          <h3 class="ml20" id="part8">非免疫规划接种史</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item
                label="非免疫规划接种史："
                prop="nonVaccineHistoryListStatus"
              >
                <el-radio
                  v-model="ruleForm8.nonVaccineHistoryListStatus"
                  class="el-radio-n"
                  label="无"
                  value="无"
                  border
                  size="small"
                  @change="changeVacc2"
                  >无</el-radio
                >
                <el-radio
                  v-model="ruleForm8.nonVaccineHistoryListStatus"
                  class="el-radio-n"
                  label="有"
                  value="有"
                  border
                  size="small"
                  style="margin-right: 45px"
                  @change="changeVacc"
                  >有</el-radio
                >
              </el-form-item>
            </el-col>
            <el-row
              :gutter="25"
              style="padding-right: 12.5px; padding-left: 12.5px"
              v-if="ruleForm8.nonVaccineHistoryListStatus == '有'"
              v-for="(item, index) in ruleForm8.nonVaccineHistoryList"
              :key="item"
            >
              <el-col
                :xs="10"
                :sm="10"
                :md="10"
                :lg="10"
                :xl="10"
                class="mb20"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  style="margin-left: 150px"
                  :prop="`nonVaccineHistoryList.` + index + `.vaccineName`"
                >
                  <el-input
                    clearable
                    v-model="item.vaccineName"
                    style="height: 32px; width: 250px"
                    placeholder="请输入疫苗名称"
                    :maxlength="10"
                    ref="vaccineNameInput"
                    @keydown.enter.native="
                      nextInput('vaccinationDateInput', index)
                    "
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col
                :xs="4"
                :sm="4"
                :md="4"
                :lg="4"
                :xl="4"
                class="mb20"
                style="margin-bottom: 20px; padding: 0"
              >
                <el-form-item
                  label=""
                  style="margin-left: 50px"
                  :prop="`nonVaccineHistoryList.` + index + `.vaccinationDate`"
                  :rules="[
                    {
                      required: false,
                      validator: validateJzDate,
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    clearable
                    v-model="item.vaccinationDate"
                    style="height: 32px; width: 200px"
                    placeholder="请输入接种日期"
                    :maxlength="10"
                    ref="vaccinationDateInput"
                    @keydown.enter.native="
                      nextInput('vaccinationSiteInput', index)
                    "
                  >
                  </el-input>
                </el-form-item>
              </el-col>
              <el-col
                :xs="10"
                :sm="10"
                :md="10"
                :lg="10"
                :xl="10"
                class="mb20"
                style="margin-bottom: 20px"
              >
                <el-form-item
                  label=""
                  style="margin-left: 100px"
                  :prop="`nonVaccineHistoryList.` + index + `.vaccinationSite`"
                >
                  <el-input
                    clearable
                    v-model="item.vaccinationSite"
                    style="height: 32px; width: 250px"
                    placeholder="请输入接种机构"
                    :maxlength="10"
                    ref="vaccinationSiteInput"
                    @keydown.enter.native="
                      nextInput('vaccineNameInput', index + 1)
                    "
                  >
                  </el-input>
                  <el-icon
                    v-if="index == 0"
                    class="iconBox"
                    @click.prevent="addVacc"
                    ><CirclePlusFilled
                  /></el-icon>
                  <el-icon
                    v-else
                    class="iconBox"
                    @click.prevent="moveVacc(item)"
                    ><RemoveFilled
                  /></el-icon>
                </el-form-item>
              </el-col>
            </el-row>
          </el-row>
          <div class="shell"></div>
        </el-form>

        <!-- 用药情况 -->
        <el-form
          :model="drugValidateForm"
          ref="drugValidateFormRef"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="drugValidateRules"
        >
          <h3 class="ml20" id="part10">用药情况</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="服药依从性：" prop="medicationAdherence">
                <el-radio-group v-model="drugValidateForm.medicationAdherence">
                  <el-radio
                    label="规律"
                    value="规律"
                    name="medicationAdherence"
                  ></el-radio>
                  <el-radio
                    label="间断"
                    value="间断"
                    name="medicationAdherence"
                  ></el-radio>
                  <el-radio
                    label="不服药"
                    value="不服药"
                    name="medicationAdherence"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="25">
            <el-col :xs="21" :sm="21" :md="21" :lg="21" :xl="21" class="mb20">
              <el-form-item label="药品">
                <div
                  style="
                    border-bottom: 1px solid #ccc;
                    width: 100%;
                    height: 20px;
                  "
                ></div>
              </el-form-item>
            </el-col>
            <el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3" class="mb20">
              <el-button type="primary" @click="addDrug" size="default"
                >新增</el-button
              >
            </el-col>
          </el-row>
          <el-row
            :gutter="25"
            style="
              padding-right: 12.5px;
              padding-left: 12.5px;
              margin-bottom: 20px;
            "
            v-for="(item, index) in drugValidateForm.medicationList"
            :key="item"
          >
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20 flexBox"
            >
              <el-col :span="6" style="text-align: right; line-height: 32px"
                >药品名称:</el-col
              >
              <el-form-item
                label=""
                :prop="`medicationList.` + index + `.medicationName`"
                :rules="[
                  {
                    required: true,
                    message: '药品名称不能为空',
                    trigger: 'blur',
                  },
                ]"
              >
                <el-input
                  style="height: 32px; width: 250px"
                  @focus="getShow"
                  v-model="item.medicationName"
                  placeholder="请输入药品名称"
                  :maxlength="100"
                  clearable
                  ref="drugInput"
                  @keydown.enter.native="
                    nextInput('medicationTimeInput', index)
                  "
                />
              </el-form-item>
            </el-col>

            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20 flexBox"
            >
              <el-col :span="6" style="text-align: right; line-height: 32px"
                >用药时间:</el-col
              >
              <el-form-item
                :prop="`medicationList.` + index + `.medicationTime`"
                :rules="[
                  {
                    required: true,
                    message: '用药时间不能为空',
                    trigger: 'blur',
                  },
                ]"
              >
                <el-input
                  style="height: 32px; width: 250px"
                  v-model="item.medicationTime"
                  placeholder="请输入用药时间"
                  :maxlength="10"
                  clearable
                  ref="medicationTimeInput"
                  @keydown.enter.native="nextInput('frequencyDayInput', index)"
                />

                <el-icon class="iconBox" @click.prevent="moveDrug(item)"
                  ><RemoveFilled
                /></el-icon>
              </el-form-item>
            </el-col>
            <!-- <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20 flexBox"
              v-show="tipshow"
            >
              <div class="tip">
                <span>外院或自购药品请在名称后备注(外院)或(自购)</span>
              </div>
            </el-col> -->
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
              <el-form-item
                :prop="`medicationList.` + index + `.medicationType`"
                label="类型："
              >
                <el-radio-group v-model="item.medicationType">
                  <el-radio
                    label="外院"
                    value="外院"
                    name="medicationType"
                  ></el-radio>
                  <el-radio
                    label="自购"
                    value="自购"
                    name="medicationType"
                  ></el-radio>
                  <el-radio
                    label="本院"
                    value="本院"
                    name="medicationType"
                  ></el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20 flexBox"
            >
              <el-col :span="6" style="text-align: right; line-height: 32px"
                >频次:</el-col
              >
              <div style="display: flex; width: 100%">
                <el-form-item
                  :prop="`medicationList.` + index + `.frequencyDay`"
                  :rules="[
                    {
                      required: true,
                      message: '用药频次（天）不能为空',
                      trigger: 'blur',
                    },
                    {
                      validator: (rule, value, callback) => {
                        const isNumber = /^\d+$/.test(value);
                        if (!isNumber) {
                          callback(new Error('请输入数字'));
                        } else {
                          callback();
                        }
                      },
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    style="height: 32px; width: 125px"
                    v-model="item.frequencyDay"
                    :maxlength="2"
                    clearable
                    ref="frequencyDayInput"
                    @keydown.enter.native="
                      nextInput('frequencyCountInput', index)
                    "
                  >
                    <template #append>天</template>
                  </el-input>
                </el-form-item>
                <el-form-item
                  :prop="`medicationList.` + index + `.frequencyCount`"
                  :rules="[
                    {
                      required: true,
                      message: '用药频次不能为空',
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    style="height: 32px; width: 125px"
                    v-model="item.frequencyCount"
                    :maxlength="2"
                    clearable
                    ref="frequencyCountInput"
                    @keydown.enter.native="
                      nextInput('dosagePerDayInput', index)
                    "
                  >
                    <template #append>次</template>
                  </el-input>
                </el-form-item>
              </div>
            </el-col>
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="mb20 flexBox"
            >
              <el-col :span="6" style="text-align: right; line-height: 32px"
                >每次用量:</el-col
              >
              <div style="display: flex; width: 100%">
                <el-form-item
                  :prop="`medicationList.` + index + `.dosagePerDay`"
                  :rules="[
                    {
                      required: true,
                      message: '每次用量不能为空',
                      trigger: 'blur',
                    },
                    {
                      validator: (rule, value, callback) => {
                        const isNumber = /^\d+(\.\d+)?$/.test(value);
                        if (!isNumber) {
                          callback(new Error('请输入数字'));
                        } else {
                          callback();
                        }
                      },
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    style="height: 32px; width: 125px"
                    v-model="item.dosagePerDay"
                    :maxlength="10"
                    clearable
                    ref="dosagePerDayInput"
                    @keydown.enter.native="
                      nextInput('dosagePerCountInput', index)
                    "
                  >
                    <template #append>/</template>
                  </el-input>
                </el-form-item>
                <el-form-item
                  :prop="`medicationList.` + index + `.dosagePerCount`"
                  :rules="[
                    {
                      required: true,
                      message: '每次用量不能为空',
                      trigger: 'blur',
                    },
                  ]"
                >
                  <el-input
                    style="height: 32px; width: 125px"
                    v-model="item.dosagePerCount"
                    :maxlength="20"
                    clearable
                    ref="dosagePerCountInput"
                    @keydown.enter.native="nextInput('drugInput', index + 1)"
                  >
                    <template #append>单位</template>
                  </el-input>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 体检评价 -->
        <el-form
          :model="ruleForm10"
          ref="ruleFormRef10"
          size="large"
          class="editForm"
          label-width="170px"
        >
          <h3 class="ml20" id="part11">体检评价</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="21" :md="21" :lg="21" :xl="21" class="mb20">
              <el-form-item
                label="体检是否有异常："
                prop="examAbnormalitiesListStatus"
              >
                <el-radio
                  v-model="ruleForm10.examAbnormalitiesListStatus"
                  class="el-radio-n"
                  value="无"
                  border
                  size="small"
                  @change="changeHealth2"
                  >无</el-radio
                >
                <el-radio
                  v-model="ruleForm10.examAbnormalitiesListStatus"
                  class="el-radio-n"
                  value="有"
                  border
                  size="small"
                  @change="changeHealth"
                  >有</el-radio
                >
              </el-form-item>
            </el-col>
            <el-col :xs="3" :sm="3" :md="3" :lg="3" :xl="3" class="mb20">
              <el-button type="primary" @click="addHealth" size="default"
                >新增</el-button
              >
            </el-col>
          </el-row>
          <el-row :gutter="25">
            <el-col
              :xs="24"
              :sm="12"
              :md="12"
              :lg="12"
              :xl="12"
              class="flexBox"
              v-if="ruleForm10.examAbnormalitiesListStatus == '有'"
              v-for="(item, index) in ruleForm10.examAbnormalitiesList"
              :key="item"
            >
              <el-form-item
                :label="`异常` + (index + 1) + `:`"
                :prop="`examAbnormalitiesList.` + index + `.abnormalSituation`"
              >
                <el-input
                  v-model="item.abnormalSituation"
                  placeholder="请输入异常情况"
                  style="width: 250px; height: 32px"
                  clearable
                ></el-input>
                <el-icon class="iconBox" @click.prevent="moveHealth(item)"
                  ><RemoveFilled
                /></el-icon>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
        <!-- 健康指导 -->
        <el-form
          :model="ruleForm11"
          ref="ruleFormRef11"
          size="large"
          class="editForm"
          label-width="170px"
          :rules="rules11"
        >
          <h3 class="ml20" id="part12">健康指导</h3>
          <el-row :gutter="25">
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="健康指导：" prop="healthGuidanceList">
                <el-checkbox-group v-model="ruleForm11.healthGuidanceList">
                  <el-checkbox
                    label="纳入慢性病患者健康管理"
                    value="纳入慢性病患者健康管理"
                    style="margin-right: 70px"
                  />
                  <el-checkbox
                    label="建议复查"
                    value="建议复查"
                    style="margin-right: 70px"
                    @change="headlthChange"
                  />
                  <el-checkbox
                    label="建议转诊"
                    value="建议转诊"
                    @change="headlthChange2"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="危险因素控制：" prop="riskControlList">
                <el-checkbox-group v-model="ruleForm11.riskControlList">
                  <el-checkbox label="戒烟" value="戒烟" />
                  <el-checkbox label="健康饮酒" value="健康饮酒" />
                  <el-checkbox label="饮食" value="饮食" />
                  <el-checkbox label="锻炼" value="锻炼" />
                  <el-checkbox label="预防跌倒" value="预防跌倒" />
                  <el-checkbox label="预防骨质疏松" value="预防骨质疏松" />
                  <el-checkbox label="流感疫苗接种" value="流感疫苗接种" />
                  <el-checkbox label="肺炎疫苗接种" value="肺炎疫苗接种" />
                  <el-checkbox :label="moveWaist" :value="moveWaist" />
                  <el-checkbox :label="moveWidth" :value="moveWidth" />

                  <el-checkbox label="其他" value="其他" />
                </el-checkbox-group>
                <el-form-item
                  label=""
                  prop="riskControlOther"
                  v-if="ruleForm11.riskControlList.includes('其他')"
                >
                  <el-input
                    v-model="ruleForm11.riskControlOther"
                    style="width: 500px; height: 32px"
                    clearable
                  />
                </el-form-item>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
              <el-form-item label="拒检项目：" prop="refusedTestsList">
                <el-checkbox-group v-model="ruleForm11.refusedTestsList">
                  <el-checkbox label="无" value="无" @change="rejectedChange" />
                  <el-checkbox
                    label="血常规"
                    value="血常规"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="尿常规"
                    value="尿常规"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="肝功能"
                    value="肝功能"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="肾功能"
                    value="肾功能"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="空腹血糖"
                    value="空腹血糖"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="血脂"
                    value="血脂"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="心电图"
                    value="心电图"
                    @change="rejectedChange2"
                  />
                  <el-checkbox
                    label="腹部B超"
                    value="腹部B超"
                    @change="rejectedChange2"
                  />
                </el-checkbox-group>
              </el-form-item>
            </el-col>
            <el-col
              :xs="24"
              :sm="24"
              :md="24"
              :lg="24"
              :xl="24"
              class="mb20 flexBox"
              v-if="!ruleForm11.refusedTestsList.includes('无')"
            >
              <el-form-item label="拒检原因：" prop="refusalReasonList">
                <el-checkbox-group v-model="ruleForm11.refusalReasonList">
                  <el-checkbox
                    style="margin-right: 35px"
                    label="病情原因"
                    value="病情原因"
                  />
                  <el-checkbox
                    style="margin-right: 35px"
                    label="没有空腹"
                    value="没有空腹"
                  />
                  <el-checkbox
                    style="margin-right: 35px"
                    label="个人原因"
                    value="个人原因"
                  />
                  <el-checkbox
                    style="margin-right: 35px"
                    label="其他"
                    value="其他"
                  />
                </el-checkbox-group>
              </el-form-item>
              <el-form-item
                label=""
                prop="refusalReasonListOther"
                v-if="ruleForm11.refusalReasonList.includes('其他')"
              >
                <el-input
                  v-model="ruleForm11.refusalReasonListOther"
                  placeholder="请输入拒检原因"
                  style="width: 250px; height: 32px"
                  clearable
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="检查医生：" prop="exaDoctor">
                <!-- <el-input
                  v-model="ruleForm11.exaDoctor"
                  placeholder="请输入检查医生"
                  style="width: 250px; height: 32px"
                  clearable
                /> -->
                <el-autocomplete
                  v-model.lazy="ruleForm11.exaDoctor"
                  :fetch-suggestions="querySearchAsync"
                  placeholder="请输入检查医生"
                  style="width: 250px; height: 32px"
                  clearable
                >
                  <!-- @select="handleSelect" -->
                </el-autocomplete>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="录入人：" prop="inputPerson">
                <el-input
                  v-model="ruleForm11.inputPerson"
                  placeholder="请输入录入人"
                  style="width: 250px; height: 32px"
                  clearable
                  disabled
                />
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="体检日期：" prop="exaTime">
                <el-date-picker
                  v-model="ruleForm.exaTime"
                  :disabled-date="disableFutureDates"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  style="width: 250px; height: 32px"
                  ref="exaTimeDiabetesInput"
                />
                <!-- @keydown.enter.native="nextInput('respDoctorInput')" -->
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="下次年检日期：" prop="nextYearExaTime">
                <el-date-picker
                  disabled
                  v-model="ruleForm11.nextYearExaTime"
                  ref="nextFollowTimeDiabetesInpu"
                  :picker-options="pickerOptions1"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  style="width: 250px; height: 32px"
                ></el-date-picker>
              </el-form-item>
            </el-col>

            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="创建日期：" prop="createTime">
                <el-date-picker
                  disabled
                  v-model="ruleForm11.createTime"
                  ref="createTimeInput"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  style="width: 250px; height: 32px"
                ></el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
              <el-form-item label="诊疗信息导入日期：" prop="importTime">
                <el-date-picker
                  disabled
                  v-model="ruleForm11.importTime"
                  ref="importTimeInput"
                  type="date"
                  format="YYYY-MM-DD"
                  value-format="YYYY-MM-DD"
                  style="width: 250px; height: 32px"
                ></el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="shell"></div>
        </el-form>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <div class="status-indicators">
            <div class="indicator">
              <span class="square yellow"></span>
              <span class="text">质控-告警类</span>
            </div>
            <div class="indicator">
              <span class="square red"></span>
              <span class="text">质控-错误类</span>
            </div>
          </div>
          <span class="button-group">
            <el-button @click="cancel" size="large">取 消</el-button>
            <el-button type="primary" @click="submit" size="large"
              >确 定</el-button
            >
          </span>
        </div>
      </template>
    </el-dialog>
    <el-dialog
      v-model="selfCareAssessmentVisible"
      append-to-body
      lock-scroll
      title="老年人生活自理能力评估表"
      top="3vh"
      width="80vw"
    >
      <ElderlySelfCareAssessment
        @update="updateSelfCareAssessment"
        @close="selfCareAssessmentVisible = false"
        :DialogDate="DialogDate"
      />
    </el-dialog>
  </div>
</template>

<script>
import http from "@/utils/request";
import ElderlySelfCareAssessment from "./ElderlySelfCareAssessment.vue";
import { ElMessage } from "element-plus";
import { debounce } from "lodash";
const disableFutureDates = (time) => time > new Date();
export default {
  components: {
    ElderlySelfCareAssessment,
  },
  props: {
    dialogObj: {
      type: Object,
      default: () => ({
        isDialogVisible: false,
        editResidentsTitle: "",
        DialogDate: {},
      }),
    },
  },
  data() {
    const validtrue = (rule, value, callback) => {
      if (value == "" || !value || value.length == 0) {
        callback(new Error("此项为必填"));
      } else {
        callback();
      }
    };
    //姓名
    const validname = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入姓名"));
      } else if (!/^[\u4e00-\u9fa5A-Za-z]+$/.test(value)) {
        callback(new Error("请输入正确的姓名"));
      } else {
        callback();
      }
    };
    //性别
    const validsex = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请选择性别"));
      } else {
        callback();
      }
    };
    //身份证

    const validatorIdCard = (rule, value, callback) => {
      setTimeout(() => {
        //@ts-ignore
        const value2 = this.ruleForm.cardNumber;
        if (value2 == "") {
          callback(new Error("请输入证件号码"));
          //@ts-ignore
        } else if (
          //@ts-ignore
          !/^\d{15}|^\d{17}[a-z]$/i.test(value2) &&
          //@ts-ignore
          this.ruleForm.cardType == "居民身份证"
        ) {
          callback(new Error("请输入正确的证件号码"));
        } else {
          callback();
        }
      }, 200);
    };
    //联系人
    const validateContactName = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入联系人名"));
      } else {
        callback();
      }
    };
    //联系人电话
    const validateContactPhone = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入联系人电话"));
      } else {
        callback();
      }
    };
    //户籍地址
    const validateAddressHousehold = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入户籍地址"));
      } else {
        callback();
      }
    };

    //出生日期
    const validatdateOfBirth = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请选择正确的出生日期"));
      } else {
        callback();
      }
    };
    //联系方式
    const validateMobile = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入联系方式"));
      }
      // else if (/^\d{11}$|^\d{4}-\d{1,7}$/.test(value)) {
      //   callback();
      // }
      else {
        callback();
      }
    };

    //身高
    const validatheight = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入身高"));
        this.setBoxShadow("heightInput", "red");
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确的身高"));
        this.setBoxShadow("heightInput", "red");
      } else if (value > 250.0 || value < 50.0) {
        callback(new Error("请输入正确的身高"));
        this.setBoxShadow("heightInput", "red");
      } else {
        if (
          (value > 250.0 && value < 220.0) ||
          (value > 50.0 && value < 120.0)
        ) {
          this.setBoxShadow("heightInput", "#f5c400");
        } else if (value > 250.0 || value < 50.0) {
          this.setBoxShadow("heightInput", "red");
        } else {
          this.setBoxShadow("weightInput", "#ccc");
        }
        callback();
      }
    };
    //体重
    const validatweight = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入体重"));
        this.setBoxShadow("weightInput", "red");
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确的体重"));
        this.setBoxShadow("weightInput", "red");
      } else if (value > 300.0 || value < 20.0) {
        callback(new Error("请输入正确的体重"));
        this.setBoxShadow("weightInput", "red");
      } else {
        if (
          (value >= 100.0 && value <= 300.0) ||
          (value >= 20.0 && value <= 40.0)
        ) {
          this.setBoxShadow("weightInput", "#f5c400");
        } else if (value > 300.0 || value < 20.0) {
          this.setBoxShadow("weightInput", "red");
        } else {
          this.setBoxShadow("weightInput", "#ccc");
        }
        callback();
      }
    };
    //腰围
    const validatwaist = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入腰围"));
        this.setBoxShadow("waistInput", "red");
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确的腰围"));
        this.setBoxShadow("waistInput", "red");
      } else if (value > 300.0 || value < 35.0) {
        callback(new Error("请输入正确的腰围"));
        this.setBoxShadow("waistInput", "red");
      } else {
        //@ts-ignore
        if (this.ruleForm.gender == "男") {
          if (value > 90.0 && value <= 300.0) {
            this.setBoxShadow("waistInput", "#f5c400");
          } else {
            this.setBoxShadow("waistInput", "#ccc");
          }
        }
        //@ts-ignore
        else if (this.ruleForm.gender == "女") {
          if (
            (value > 85.0 && value <= 300.0) ||
            (value >= 35.0 && value <= 60.0)
          ) {
            this.setBoxShadow("waistInput", "#f5c400");
          } else {
            this.setBoxShadow("waistInput", "#ccc");
          }
        }
        callback();
      }
    };
    //体温
    const validattemperature = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入体温"));
        // this.setBoxShadow("temperatureInput", "red");
        this.setBoxShadow("temperatureInput", "#ccc");
        callback();
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确的体温"));
        this.setBoxShadow("temperatureInput", "red");
      } else if (value > 43.0 || value < 30.0) {
        callback(new Error("请输入正确的体温"));
        this.setBoxShadow("temperatureInput", "red");
      } else {
        if (
          (value >= 30.0 && value <= 36.2) ||
          (value >= 37.3 && value <= 43.0)
        ) {
          this.setBoxShadow("temperatureInput", "#f5c400");
        } else if (value > 43.0 || value < 30.0) {
          this.setBoxShadow("temperatureInput", "red");
        } else {
          this.setBoxShadow("temperatureInput", "#ccc");
        }

        callback();
      }
    };
    //脉率
    const validatheartRate = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入脉率"));
        // this.setBoxShadow("pulseInput", "red");
        this.setBoxShadow("pulseInput", "#ccc");
        callback();
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确的脉率"));
        this.setBoxShadow("pulseInput", "red");
      } else if (value > 300.0 || value < 30.0) {
        callback(new Error("请输入正确的脉率"));
        this.setBoxShadow("pulseInput", "red");
      } else {
        if ((value >= 30 && value < 60) || (value > 120 && value <= 300)) {
          this.setBoxShadow("pulseInput", "#f5c400");
        } else if (value > 300.0 || value < 30.0) {
          this.setBoxShadow("pulseInput", "red");
        } else {
          this.setBoxShadow("pulseInput", "#ccc");
        }
        callback();
      }
    };
    // 呼吸频率
    const validatbreathingFrequency = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入呼吸频率"));
        // this.setBoxShadow("breathingRateInput", "red");
        this.setBoxShadow("breathingRateInput", "#ccc");
        callback();
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确呼吸频率"));
        this.setBoxShadow("breathingRateInput", "red");
      } else if (value > 60.0 || value < 6.0) {
        callback(new Error("请输入正确呼吸频率"));
        this.setBoxShadow("breathingRateInput", "red");
      } else {
        if ((value >= 6 && value < 12) || (value > 20 && value <= 60)) {
          this.setBoxShadow("breathingRateInput", "#f5c400");
        } else if (value > 60 || value < 6) {
          this.setBoxShadow("breathingRateInput", "red");
        } else {
          this.setBoxShadow("breathingRateInput", "#ccc");
        }
        callback();
      }
    };
    //左侧舒张压
    const validatsystolic = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入舒张压"));
        // this.setBoxShadow("leftDiastolicInput", "red");
        this.setBoxShadow("leftDiastolicInput", "#ccc");
        callback();
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确舒张压"));
        this.setBoxShadow("leftDiastolicInput", "red");
      } else if (value > 140 || value < 30) {
        callback(new Error("请输入正确舒张压"));
        this.setBoxShadow("leftDiastolicInput", "red");
      } else {
        if ((value >= 90 && value <= 140) || (value >= 30 && value < 60)) {
          this.setBoxShadow("leftDiastolicInput", "#f5c400");
        } else if (value > 250 || value < 30) {
          this.setBoxShadow("leftDiastolicInput", "red");
        } else {
          this.setBoxShadow("leftDiastolicInput", "#ccc");
        }
        callback();
      }
    };
    //右侧舒张压
    const validatsystolic1 = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入舒张压"));
        // this.setBoxShadow("rightDiastolicInput", "red");
        this.setBoxShadow("rightDiastolicInput", "#ccc");
        callback();
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确舒张压"));
        this.setBoxShadow("rightDiastolicInput", "red");
      } else if (value > 140 || value < 30) {
        callback(new Error("请输入正确舒张压"));
        this.setBoxShadow("rightDiastolicInput", "red");
      } else {
        if ((value >= 90 && value <= 140) || (value >= 30 && value < 60)) {
          this.setBoxShadow("rightDiastolicInput", "#f5c400");
        } else if (value > 250 || value < 30) {
          this.setBoxShadow("rightDiastolicInput", "red");
        } else {
          this.setBoxShadow("rightDiastolicInput", "#ccc");
        }
        callback();
      }
    };
    // 左侧收缩压
    const validatdiastolic = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入收缩压"));
        // this.setBoxShadow("leftSystolicInput", "red");
        this.setBoxShadow("leftSystolicInput", "#ccc");
        callback();
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确收缩压"));
        this.setBoxShadow("leftSystolicInput", "red");
      } else if (value > 250 || value < 30) {
        callback(new Error("请输入正确收缩压"));
        this.setBoxShadow("leftSystolicInput", "red");
      } else {
        //@ts-ignore
        if (
          (value >= 140 && value <= 250) ||
          (value >= 150 && value <= 250 && this.ruleForm.age >= 65) ||
          (value >= 30 && value < 90)
        ) {
          this.setBoxShadow("leftSystolicInput", "#f5c400");
        } else if (value > 250 || value < 30) {
          this.setBoxShadow("leftSystolicInput", "red");
        } else {
          this.setBoxShadow("leftSystolicInput", "#ccc");
        }
        callback();
      }
    };
    // 右侧收缩压
    const validatdiastolic1 = (rule, value, callback) => {
      if (!value ) {
        // callback(new Error("请输入收缩压"));
        // this.setBoxShadow("rightSystolicInput", "red");
        this.setBoxShadow("rightSystolicInput", "#ccc");
        callback();
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确收缩压"));
        this.setBoxShadow("rightSystolicInput", "red");
      } else if (value > 250 || value < 30) {
        callback(new Error("请输入正确收缩压"));
        this.setBoxShadow("rightSystolicInput", "red");
      } else {
        //@ts-ignore
        if (
          (value >= 140 && value <= 250) ||
          (value >= 150 && value <= 250 && this.ruleForm.age >= 65) ||
          (value >= 30 && value < 90)
        ) {
          this.setBoxShadow("rightSystolicInput", "#f5c400");
        } else if (value > 250 || value < 30) {
          this.setBoxShadow("rightSystolicInput", "red");
        } else {
          this.setBoxShadow("rightSystolicInput", "#ccc");
        }
        callback();
      }
    };
    //随机血糖
    const validatrandomBloodSugar = (rule, value, callback) => {
      if (!value) {
        callback();
        this.setBoxShadow("randomGlucoseInput", "#ccc");
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确随机血糖"));
        this.setBoxShadow("randomGlucoseInput", "red");
      } else if (value > 43.0 || value < 2.0) {
        callback(new Error("请输入正确随机血糖"));
        this.setBoxShadow("randomGlucoseInput", "red");
      } else {
        if (
          (value >= 10.0 && value <= 43.0) ||
          (value >= 2.0 && value <= 3.9)
        ) {
          this.setBoxShadow("randomGlucoseInput", "#f5c400");
        } else if (value > 43.0 || value < 2.0) {
          this.setBoxShadow("randomGlucoseInput", "red");
        } else {
          this.setBoxShadow("randomGlucoseInput", "#ccc");
        }
        callback();
      }
    };
    //空腹血糖
    const validatrandomBloodSugar1 = (rule, value, callback) => {
      if (!value) {
        callback();
        this.setBoxShadow("fastingBloodGlucoseInput", "#ccc");
      } else if (!/^\d+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确空腹血糖"));
        this.setBoxShadow("fastingBloodGlucoseInput", "red");
      } else if (value > 43.0 || value < 2.0) {
        callback(new Error("请输入正确空腹血糖"));
        this.setBoxShadow("fastingBloodGlucoseInput", "red");
      } else {
        if (
          (value >= 10.0 && value <= 43.0) ||
          (value >= 2.0 && value <= 3.9)
        ) {
          this.setBoxShadow("fastingBloodGlucoseInput", "#f5c400");
        } else if (value > 43.0 || value < 2.0) {
          this.setBoxShadow("fastingBloodGlucoseInput", "red");
        } else {
          this.setBoxShadow("fastingBloodGlucoseInput", "#ccc");
        }
        callback();
      }
    };
    //每周运动次数
    const validatweeklySports = (rule, value, callback) => {
      if (value === "") {
        callback(new Error("请输入每周运动次数"));
        this.setBoxShadow("weeklySportsInput", "red");
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确每周运动次数"));
        this.setBoxShadow("weeklySportsInput", "red");
      } else if (value > 20 || value < 0) {
        callback(new Error("请输入正确每周运动次数"));
        this.setBoxShadow("weeklySportsInput", "red");
      } else {
        if (value >= 0 && value <= 5) {
          this.setBoxShadow("weeklySportsInput", "#f5c400");
        } else if (value > 20) {
          this.setBoxShadow("weeklySportsInput", "red");
        } else {
          this.setBoxShadow("weeklySportsInput", "#ccc");
        }
        callback();
      }
    };
    //每次运动时间
    const validatweeklySportsTime = (rule, value, callback) => {
      if (!value) {
        callback();
        this.setBoxShadow("weeklySportsTimeInput", "#ccc");
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确每次运动时间"));
        this.setBoxShadow("weeklySportsTimeInput", "red");
      } else if (value > 600 || value < 0) {
        callback(new Error("请输入正确每次运动时间"));
        this.setBoxShadow("weeklySportsTimeInput", "red");
      } else {
        if (value >= 0 && value < 30) {
          this.setBoxShadow("weeklySportsTimeInput", "#f5c400");
        } else if (value > 600) {
          this.setBoxShadow("weeklySportsTimeInput", "red");
        } else {
          this.setBoxShadow("weeklySportsTimeInput", "#ccc");
        }
        callback();
      }
    };
    //坚持运动时间
    const validathabitTime = (rule, value, callback) => {
      if (!value) {
        callback();
        this.setBoxShadow("habitTimeInput", "#ccc");
      } else {
        if (!/^\d+(\.\d{1})?$/.test(value)) {
          callback(new Error("请输入正确坚持运动时间"));
          this.setBoxShadow("habitTimeInput", "red");
          //@ts-ignore
        } else if (value > this.ruleForm.age || value < 0) {
          callback(new Error("请输入正确坚持运动时间"));
          this.setBoxShadow("habitTimeInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value < this.ruleForm.age) {
            // this.setBoxShadow("habitTimeInput", "red");
            // callback(new Error("请输入正确坚持运动时间"));
          } else {
            this.setBoxShadow("habitTimeInput", "#ccc");
          }
          callback();
          this.setBoxShadow("habitTimeInput", "#ccc");
        }
      }
    };
    //运动方式
    const validatweeklySportsType = (rule, value, callback) => {
      if (value === "") {
        callback();
      } else {
        callback();
      }
    };
    //日吸烟量
    const validatdailySmoke = (rule, value, callback) => {
      if (!value) {
        callback();
        this.setBoxShadow("dailySmokeInput", "#ccc");
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确日吸烟量"));
        this.setBoxShadow("dailySmokeInput", "red");
      } else if (value > 100 || value < 0) {
        callback(new Error("请输入正确日吸烟量"));
        this.setBoxShadow("dailySmokeInput", "red");
      } else {
        if (value > 20 && value <= 100) {
          this.setBoxShadow("dailySmokeInput", "#f5c400");
        } else if (value > 100) {
          this.setBoxShadow("dailySmokeInput", "red");
        } else {
          this.setBoxShadow("dailySmokeInput", "#ccc");
        }
        callback();
        this.setBoxShadow("dailySmokeInput", "#ccc");
      }
    };
    //开始吸烟年龄
    const validatstartSmoke = (rule, value, callback) => {
      if (!value) {
        callback();
      } else {
        if (!/^\d+$/.test(value)) {
          callback(new Error("请输入正确开始吸烟年龄"));
          this.setBoxShadow("startSmokeInput", "red");
          //@ts-ignore
        } else if (value > this.ruleForm.age || value == 0) {
          callback(new Error("请输入正确开始吸烟年龄"));
          this.setBoxShadow("startSmokeInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value > this.ruleForm.age) {
            this.setBoxShadow("startSmokeInput", "red");
          } else {
            this.setBoxShadow("startSmokeInput", "#ccc");
          }
          callback();
        }
      }
    };
    const validatquitSmoke = (rule, value, callback) => {
      if (!value) {
        callback();
      } else {
        if (!/^\d+$/.test(value)) {
          callback(new Error("请输入正确戒烟年龄"));
          this.setBoxShadow("quitSmokeInput", "red");
        } else if (
          //@ts-ignore
          value > this.ruleForm.age ||
          value == 0 ||
          //@ts-ignore
          value < this.ruleForm4.startSmokingAge
        ) {
          callback(new Error("请输入正确戒烟年龄"));
          this.setBoxShadow("quitSmokeInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value > this.ruleForm.age) {
            this.setBoxShadow("quitSmokeInput", "red");
          } else {
            this.setBoxShadow("quitSmokeInput", "#ccc");
          }
          callback();
        }
      }
    };
    //日饮酒量
    const validatdailyDrink = (rule, value, callback) => {
      if (!value) {
        callback();
      } else if (!/^\d+$/.test(value)) {
        callback(new Error("请输入正确日饮酒量"));
        this.setBoxShadow("dailyDrinkInput", "red");
      } else if (value > 50 || value < 0) {
        callback(new Error("请输入正确日饮酒量"));
        this.setBoxShadow("dailyDrinkInput", "red");
      } else {
        if (value > 10 && value <= 50) {
          this.setBoxShadow("dailyDrinkInput", "#f5c400");
        } else if (value > 50) {
          this.setBoxShadow("dailyDrinkInput", "red");
        } else {
          this.setBoxShadow("dailyDrinkInput", "#ccc");
        }
        callback();
      }
    };
    //开始饮酒年龄
    const validatstartDrink = (rule, value, callback) => {
      if (!value) {
        callback();
      } else {
        if (!/^\d+$/.test(value)) {
          callback(new Error("请输入正确开始饮酒年龄"));
          this.setBoxShadow("startDrinkInput", "red");
          //@ts-ignore
        } else if (value > this.ruleForm.age || value == 0) {
          callback(new Error("请输入正确开始饮酒年龄"));
          this.setBoxShadow("startDrinkInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value > this.ruleForm.age) {
            this.setBoxShadow("startDrinkInput", "red");
          } else {
            this.setBoxShadow("startDrinkInput", "#ccc");
          }
          callback();
        }
      }
    };
    //从业时间
    const validatYears = (rule, value, callback) => {
      if (!value) {
        callback();
      } else {
        if (!/^\d+$/.test(value)) {
          callback(new Error("请输入正确从业时间"));
          this.setBoxShadow("yearsOfServiceInput", "red");
          //@ts-ignore
        } else if (value > this.ruleForm.age || value < 0) {
          callback(new Error("请输入正确从业时间"));
          this.setBoxShadow("yearsOfServiceInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value > this.ruleForm.age) {
            this.setBoxShadow("yearsOfServiceInput", "red");
          } else {
            this.setBoxShadow("yearsOfServiceInput", "#ccc");
          }
          callback();
        }
      }
    };
    //戒酒年龄
    const validatquitDrink = (rule, value, callback) => {
      if (!value) {
        callback();
      } else {
        if (!/^\d+$/.test(value)) {
          callback(new Error("请输入正确戒酒年龄"));
          this.setBoxShadow("quitDrinkInput", "red");
          //@ts-ignore
        } else if (value > this.ruleForm.age || value < 0) {
          callback(new Error("请输入正确戒酒年龄"));
          this.setBoxShadow("quitDrinkInput", "red");
        } else {
          //@ts-ignore
          if (value >= 0 && value > this.ruleForm.age) {
            this.setBoxShadow("quitDrinkInput", "red");
          } else {
            this.setBoxShadow("quitDrinkInput", "#ccc");
          }
          callback();
        }
      }
    };
    //左侧裸眼视力
    const validleftEye = (rule, value, callback) => {
      if (value === "" || value === "0") {
        callback(new Error("请输入左侧裸眼视力"));
        this.setBoxShadow("leftEyeInput", "red");
      } else if (!/^[\d\u4e00-\u9fa5]+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确左侧裸眼视力"));
        this.setBoxShadow("leftEyeInput", "red");
        //@ts-ignore
      } else if (value > 5.3 || value < 0.0 || (value > 2.0 && value < 4.0)) {
        callback(new Error("请输入正确左侧裸眼视力"));
        this.setBoxShadow("leftEyeInput", "red");
      } else {
        //@ts-ignore
        if (value > 5.3) {
          this.setBoxShadow("leftEyeInput", "red");
        } else if (
          (value >= 4.0 && value < 5.0) ||
          (value >= 0.1 && value < 1.0)
        ) {
          this.setBoxShadow("leftEyeInput", "#f5c400");
        } else {
          this.setBoxShadow("leftEyeInput", "#ccc");
        }
        callback();
      }
    };
    //右侧裸眼视力
    const validleftEye1 = (rule, value, callback) => {
      if (value === "" || value === "0") {
        callback(new Error("请输入右侧裸眼视力"));
        this.setBoxShadow("rightEyeInput", "red");
      } else if (!/^[\d\u4e00-\u9fa5]+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确右侧裸眼视力"));
        this.setBoxShadow("rightEyeInput", "red");
        //@ts-ignore
      } else if (value > 5.3 || value < 0.0 || (value > 2.0 && value < 4.0)) {
        callback(new Error("请输入正确右侧裸眼视力"));
        this.setBoxShadow("rightEyeInput", "red");
      } else {
        //@ts-ignore
        if (value > 5.3) {
          this.setBoxShadow("rightEyeInput", "red");
        } else if (
          (value >= 4.0 && value < 5.0) ||
          (value >= 0.1 && value < 1.0)
        ) {
          this.setBoxShadow("rightEyeInput", "#f5c400");
        } else {
          this.setBoxShadow("rightEyeInput", "#ccc");
        }
        callback();
      }
    };
    //左侧矫正视力
    const validrightEye = (rule, value, callback) => {
      if (value === "" || value === "0") {
        callback(new Error("请输入左侧矫正视力"));
        this.setBoxShadow("leftjzEyeInput", "red");
      } else if (!/^[\d\u4e00-\u9fa5]+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确左侧矫正视力"));
        this.setBoxShadow("leftjzEyeInput", "red");
        //@ts-ignore
      } else if (value > 5.3 || value < 0.0 || (value > 2.0 && value < 4.0)) {
        callback(new Error("请输入正确左侧矫正视力"));
        this.setBoxShadow("leftjzEyeInput", "red");
      } else {
        if (value > 5.3) {
          this.setBoxShadow("leftjzEyeInput", "red");
        } else if (
          (value >= 4.0 && value < 5.0) ||
          (value >= 0.1 && value < 1.0)
        ) {
          this.setBoxShadow("leftjzEyeInput", "#f5c400");
        } else {
          this.setBoxShadow("leftjzEyeInput", "#ccc");
        }
        callback();
      }
    };
    //右侧矫正视力
    const validrightEye1 = (rule, value, callback) => {
      if (value === "" || value === "0") {
        callback(new Error("请输入右侧矫正视力"));
        this.setBoxShadow("rightjzEyeInput", "red");
      } else if (!/^[\d\u4e00-\u9fa5]+(\.\d)?$/.test(value)) {
        callback(new Error("请输入正确右侧矫正视力"));
        this.setBoxShadow("rightjzEyeInput", "red");
        //@ts-ignore
      } else if (value > 5.3 || value < 0.0 || (value > 2.0 && value < 4.0)) {
        callback(new Error("请输入正确右侧矫正视力"));
        this.setBoxShadow("rightjzEyeInput", "red");
      } else {
        if (value > 5.3) {
          this.setBoxShadow("rightjzEyeInput", "red");
        } else if (
          (value >= 4.0 && value < 5.0) ||
          (value >= 0.1 && value < 1.0)
        ) {
          this.setBoxShadow("rightjzEyeInput", "#f5c400");
        } else {
          this.setBoxShadow("rightjzEyeInput", "#ccc");
        }
        callback();
      }
    };
    //足背动脉搏
    const validPartList = (rule, value, callback) => {
      //@ts-ignore
      if (
        this.ruleForm2.populationCategoryList.includes("糖尿病") &&
        value.length < 1
      ) {
        callback(new Error("请选择足背动脉搏动"));
      } else {
        callback();
      }
    };

    return {
      timeout: null,
      selfCareAssessmentVisible: false,
      pickerOptions1: {
        disabledDate(time) {
          return time.getTime() < Date.now();
        },
      },
      moveWaist: "减腰围(目标        CM)",
      //减体重
      moveWidth: "减体重(目标        KG)",
      addWidth: "增体重(目标        KG)",
      DialogDate: {},
      timeID: null,
      timeDate: "",
      isshow: true,
      tipshow: true,
      healthTrue: false,
      referral: false,
      referral2: false,
      // 基本信息
      ruleForm: {
        id: "",
        //姓名
        name: "",
        //身份证
        cardNumber: "",
        //证件类型
        cardType: "",
        //性别
        gender: "",
        //出生日期
        birthday: "",
        //联系方式
        phoneNumber: "",
        //体检日期
        exaTime: "",
        // 责任医生
        // respDoctor: "",
        // 年龄
        age: 0,
        //现住址
        address: "",
        //联系人
        contacts: "",
        //联系人电话
        contactsNumber: "",
        //户籍地址
        domicileAddress: "",
      },
      rules: {
        name: [{ required: true, validator: validname, trigger: "blur" }],
        gender: [{ required: true, validator: validsex, trigger: "blur" }],
        cardNumber: [
          { required: true, validator: validatorIdCard, trigger: "blur" },
        ],
        birthday: [
          { required: true, validator: validatdateOfBirth, trigger: "blur" },
        ],
        phoneNumber: [
          { required: true, validator: validateMobile, trigger: "blur" },
        ],
        // respDoctor: [{ required: true, validator: validtrue, trigger: "blur" }],
        cardType: [{ required: true, validator: validtrue, trigger: "blur" }],
        // exaTime: [{ required: true, validator: validtrue, trigger: "blur" }],
        age: [{ required: true, validator: validtrue, trigger: "blur" }],
        address: [{ required: true, validator: validtrue, trigger: "blur" }],
        contacts: [
          { required: true, validator: validateContactName, trigger: "blur" },
        ],
        contactsNumber: [
          { required: true, validator: validateContactPhone, trigger: "blur" },
        ],
        domicileAddress: [
          {
            required: true,
            validator: validateAddressHousehold,
            trigger: "blur",
          },
        ],
      },
      // 分类及症状
      ruleForm2: {
        //人群分类
        populationCategoryList: [],
        //人群分类其他
        populationCategoryOther: "",
        //人群分类输入框显示
        crowdInput: false,
        //症状
        symptomList: [],
        //症状其他
        symptomOther: "",
        //症状输入框显示
        symptomInput: false,
      },
      rules2: {
        populationCategoryList: [
          { required: true, validator: validtrue, trigger: "blur" },
        ],
        symptomList: [
          { required: true, validator: validtrue, trigger: "blur" },
        ],
      },
      // 一般情况
      ruleForm3: {
        height: "",
        //  身高（单位：厘米）
        weight: "",
        // 体重（单位：千克）
        waist: "",
        //  腰围（单位：厘米）
        temperature: "",
        //  体温（单位：摄氏度）
        pulse: "",
        //  脉率（单位：次/分钟）
        breathingRate: "",
        //  呼吸频率（单位：次/分钟）
        leftSystolic: "",
        //  左侧收缩压（单位：毫米汞柱）
        leftDiastolic: "",
        //  左侧舒张压（单位：毫米汞柱）
        rightSystolic: "",
        //  右侧收缩压（单位：毫米汞柱）
        rightDiastolic: "",
        //  右侧舒张压（单位：毫米汞柱）
        randomGlucose: "",
        //  随机血糖（单位：毫克/分升）
        fastingBloodGlucose: "",
        //  空腹血糖（单位：毫克/分升）
        // bmi: "",
        //  BMI
        healthSelfRating: "满意",
        // 健康状态自我评估
        cognition: " ",
        // 认知功能
        elderlySelfCareScore: "",
        // 生活自理能力评估
        elderlyScoreId: "",
        // 老年人生活自理能力检查表id
      },
      rules3: {
        height: [{ required: true, validator: validatheight, trigger: "blur" }],
        weight: [{ required: true, validator: validatweight, trigger: "blur" }],
        waist: [
          {
            required: true,
            validator: validatwaist,
            trigger: "blur",
          },
        ],
        //  腰围（单位：厘米）
        temperature: [
          {
            required: false,
            validator: validattemperature,
            trigger: "blur",
          },
        ],
        //  体温（单位：摄氏度）
        pulse: [
          { required: false, validator: validatheartRate, trigger: "blur" },
        ],
        //  脉率（单位：次/分钟）
        breathingRate: [
          {
            required: false,
            validator: validatbreathingFrequency,
            trigger: "blur",
          },
        ],
        //  呼吸频率（单位：次/分钟）
        leftSystolic: [
          {
            required: false,
            validator: validatdiastolic,
            trigger: "blur",
          },
        ],
        //  左侧收缩压（单位：毫米汞柱）
        leftDiastolic: [
          {
            required: false,
            validator: validatsystolic,
            trigger: "blur",
          },
        ],
        //  左侧舒张压（单位：毫米汞柱）
        rightSystolic: [
          {
            required: false,
            validator: validatdiastolic1,
            trigger: "blur",
          },
        ],
        //  右侧收缩压（单位：毫米汞柱）
        rightDiastolic: [
          {
            required: false,
            validator: validatsystolic1,
            trigger: "blur",
          },
        ],
        //  右侧舒张压（单位：毫米汞柱）
        randomGlucose: [
          {
            // required: true,
            validator: validatrandomBloodSugar,
            trigger: "blur",
          },
          //随机血糖（单位：毫克/分升）
        ],
        fastingBloodGlucose: [
          {
            validator: validatrandomBloodSugar1,
            trigger: "blur",
          },
          //随机血糖（单位：毫克/分升）
        ],
        healthSelfRating: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        cognition: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        elderlySelfCareScore: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },
      //生活方式
      ruleForm4: {
        weeklyExercises: "",
        //  每周运动次数（单位：次）
        exerciseTime: "",
        //  每次运动时间（单位：分钟）
        exerciseYears: "",
        //  坚持运动时间（单位：年）
        exerciseType: "",
        //  运动方式（例如：跑步、游泳、瑜伽等）
        dietPartTwo: [],
        //  饮食习惯（例如：素食、荤食、高蛋白饮食等）
        dietPartOne: "荤素均衡",
        //  饮食习惯（例如：素食、荤食、高蛋白饮食等）
        smoking: "从不吸烟",
        //  吸烟情况（例如：从不吸烟、偶尔吸烟、每天吸烟）
        dailySmoke: "",
        //  日吸烟量（单位：支）
        startSmokingAge: "",
        //  开始吸烟年龄（单位：岁）
        quitSmokingAge: "",
        //  戒烟年龄（单位：岁）
        drinkingFrequency: "从不",
        //  饮酒频率（例如：从不饮酒、偶尔饮酒、每天饮酒）
        dailyDrinkAmount: "",
        //  日饮酒量（单位：克或毫升）
        drunkInPastYear: "",
        //  近一年是否曾醉酒（布尔值：是/否）
        startDrinkingAge: "",
        //  开始饮酒年龄（单位：岁）
        quitDrinking: "",
        //  是否戒酒（布尔值：是/否）
        quitDrinkingAge: "",
        //  戒酒年龄（单位：岁）
        drinkTypeList: [],
        //  饮酒种类（例如：白酒、啤酒、红酒等）
        drinkTypeListOther: "",
        // 其它饮酒种类
        jobHazards: "无",
        //  职业危害因素
        specificJob: "",
        // 具体职业
        yearsOfService: "",
        // 从业时间
        otherHazards: "",
        // 化学物质
        otherProtection: "有",
        // 化学物质状态
        otherProtectionOther: "",
        // 化学物质措施
        durationShow: true,
        // 每次运动时间 是否显示
      },
      rules4: {
        weeklyExercises: [
          { required: true, validator: validatweeklySports, trigger: "blur" },
        ],
        //  每周运动次数（单位：次）
        exerciseTime: [
          {
            // required: true,
            validator: validatweeklySportsTime,
            trigger: "blur",
          },
        ],
        //  每次运动时间（单位：分钟）
        exerciseYears: [
          {
            // required: true,
            validator: validathabitTime,
            trigger: "blur",
          },
        ],
        // 坚持运动时间
        exerciseType: [
          {
            // required: true,
            validator: validatweeklySportsType,
            trigger: "blur",
          },
        ],
        //运动方式
        dietPartOne: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //饮食习惯
        smoking: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //吸烟情况
        dailySmoke: [
          {
            // required: true,
            validator: validatdailySmoke,
            trigger: "blur",
          },
        ],
        //日吸烟量
        startSmokingAge: [
          {
            // required: true,
            validator: validatstartSmoke,
            trigger: "blur",
          },
        ],
        //开始吸烟年龄
        quitSmokingAge: [
          {
            // required: true,
            validator: validatquitSmoke,
            trigger: "blur",
          },
        ],
        //  戒烟年龄（单位：岁）
        drinkingFrequency: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //饮酒频率
        dailyDrinkAmount: [
          {
            // required: true,
            validator: validatdailyDrink,
            trigger: "blur",
          },
        ],
        //日饮酒量

        startDrinkingAge: [
          {
            // required: true,
            validator: validatstartDrink,
            trigger: "blur",
          },
        ],
        //开始饮酒年龄
        quitDrinkingAge: [
          {
            // required: true,
            validator: validatquitDrink,
            trigger: "blur",
          },
        ],
        jobHazards: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //职业危害因素
        //  戒烟年龄（单位：岁）
        yearsOfService: [
          {
            validator: validatYears,
            trigger: "blur",
          },
        ],
      },
      //脏器功能
      ruleForm5: {
        lips: "红润",
        //  口唇
        throatList: ["无充血"],
        //  咽部
        teethAlignmentList: ["正常"],
        //齿列
        missingTeethList: [],
        // 缺齿集合
        missing_teeth_top_left: "",
        // 缺齿左上
        missing_teeth_bottom_left: "",
        // 缺齿左下
        missing_teeth_top_right: "",
        // 缺齿右上
        missing_teeth_bottom_right: "",
        // 缺齿右下

        cavitiesList: [],
        //  龋齿集合
        //  龋齿缺齿
        cavities_top_left: "",

        cavities_bottom_left: "",

        cavities_top_right: "",

        cavities_bottom_right: "",
        denturesList: [],
        //  义齿集合

        dentures_top_left: "",

        dentures_bottom_left: "",

        dentures_top_right: "",

        dentures_bottom_right: "",

        vision: "裸眼视力",
        //视力集合
        visionList: [],
        leftEye: "",
        //左眼裸眼视力
        rightEye: "",
        //右眼裸眼视力
        leftjzEye: "",
        //左眼裸眼视力
        rightjzEye: "",
        //右眼裸眼视力
        hearing: "听见",
        //听力
        motorFunction: "可顺利完成",
        //运动功能
      },
      rules5: {
        lips: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        throatList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        teethAlignmentList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        vision: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        leftEye: [
          {
            required: true,
            validator: validleftEye,
            trigger: "blur",
          },
        ],
        rightEye: [
          {
            required: true,
            validator: validleftEye1,
            trigger: "blur",
          },
        ],

        leftjzEye: [
          {
            required: true,
            validator: validrightEye,
            trigger: "blur",
          },
        ],
        rightjzEye: [
          {
            required: true,
            validator: validrightEye1,
            trigger: "blur",
          },
        ],

        hearing: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        motorFunction: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },
      // 现存主要健康问题
      ruleForm6: {
        cerebrovascularDiseaseList: ["无"],
        //  脑血管疾病
        cerebrovascularDiseaseOther: "",
        //  脑血管疾病其他
        kidneyDiseaseList: ["无"],
        //  肾脏疾病
        kidneyDiseaseOther: "",
        //  肾脏疾病其他
        heartDiseaseList: ["无"],
        //  心脏疾病
        heartDiseaseOther: "",
        //  心脏疾病其他
        vascularDiseaseList: ["无"],
        //  血管疾病
        vascularDiseaseOther: "",
        //  血管疾病其他
        eyeDiseaseList: ["无"],
        //  眼部疾病
        eyeDiseaseOther: "",
        //  眼部疾病其他
        nervousSystemDisease: "无",
        //  神经系统疾病
        nervousSystemDiseaseOther: "",
        //  神经系统疾病输入
        otherSystemDisease: "无",
        //  其他系统疾病
        otherSystemDiseaseOther: "",
        //  其他系统疾病输入
      },
      rules6: {
        cerebrovascularDiseaseList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        kidneyDiseaseList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        heartDiseaseList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        vascularDiseaseList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        eyeDiseaseList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        nervousSystemDisease: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        otherSystemDisease: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },
      // 住院治疗情况
      ruleForm7: {
        // 病案号
        hospitalHistoryListStatus: "无",
        //  住院史
        hospitalHistoryList: [
          // {
          //   medicalInstitutionName: "",
          //   //   医疗机构名称
          //   reason: "",
          //   //  入院原因
          //   admissionDate: "",
          //   // 入院日期
          //   dischargeDate: "",
          //   // 出院日期
          //   medicalRecordNumber: "",
          //   //   病案号
          // },
        ],

        familyBedHistoryListStatus: "无",
        //  家庭病床史
        familyBedHistoryList: [
          // {
          //   medicalInstitutionName: "",
          //   //   医疗机构名称
          //   reason: "",
          //   //  入院原因
          //   bedEstablishedDate: "",
          //   // 建床日期
          //   bedRemovedDate: "",
          //   // 撤床日期
          //   medicalRecordNumber: "",
          //   //   病案号
          // },
        ],
      },
      rules7: {
        hospitalHistoryListStatus: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        familyBedHistoryListStatus: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },
      //非免疫规划接种史
      ruleForm8: {
        nonVaccineHistoryListStatus: "无",
        //  非免疫规划接种史
        nonVaccineHistoryList: [
          // {
          //   vaccineName: "",
          //   //   疫苗名称
          //   vaccinationDate: "",
          //   //  接种日期
          //   vaccinationSite: "",
          //   //接种机构
          // },
        ],
      },
      rules8: {
        nonVaccineHistoryListStatus: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },
      //查体
      ruleForm9: {
        skin: "正常",
        //  皮肤
        skinOther: "",
        //  皮肤其他
        sclera: "正常",
        //  巩膜
        scleraOther: "",
        //  巩膜其他
        lymphNodesList: ["未触及"],
        //  淋巴结
        lymphNodesOther: "",
        //  淋巴结其他
        barrelChest: "否",
        //  肺部桶状胸
        breathSounds: "正常",
        //  肺部呼吸音
        breathSoundsOther: "",
        //  肺部呼吸音异常
        ralesList: ["无"],
        //  肺部啰音
        ralesListOther: "",
        //  肺部啰音其他
        heartRhythm: "齐",
        //  心律
        heartRate: "",
        //  心率
        heartMurmur: "无",
        //  心脏杂音
        heartMurmurOther: "",
        //  心脏杂音其他

        abdominalTenderness: "无",
        //  腹部压痛
        abdominalTendernessOther: "",
        //  腹部压痛其他
        abdominalMass: "无",
        //  腹部包块
        abdominalMassOther: "",
        //  腹部包块其他
        hepatomegaly: "无",
        //  腹部肝大
        hepatomegalyOther: "",
        //  腹部肝大其他
        splenomegaly: "无",
        //  腹部脾大
        splenomegalyOther: "",
        //  腹部脾大其他
        shiftingDullness: "无",
        //  移动性浊音
        shiftingDullnessOther: "",
        //  移动性浊音其他
        legEdema: "无",
        //  下肢水肿
        dorsalPulsePartList: [""],
        //  足背动脉搏动
      },
      rules9: {
        skin: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        skinOther: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  皮肤其他
        sclera: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  巩膜
        lymphNodesList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  淋巴结
        barrelChest: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  肺部桶状胸
        breathSounds: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  肺部呼吸音
        ralesList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  肺部啰音
        heartRhythm: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  心律
        // heartRate: [
        //   {
        //     required: true,
        //     validator: validtrue,
        //     trigger: "blur",
        //   },
        // ],
        //  心率
        heartMurmur: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  心脏杂音
        abdominalTenderness: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  腹部压痛
        abdominalMass: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  腹部包块
        hepatomegaly: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  腹部肝大
        splenomegaly: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  腹部脾大
        shiftingDullness: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  移动性浊音
        legEdema: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        //  下肢水肿
        dorsalPulsePartList: [
          {
            validator: validPartList,
            trigger: "blur",
          },
        ],
        //  足背动脉搏动
      },
      //用药情况
      drugValidateForm: {
        medicationList: [],
        //服药依从性
        medicationAdherence: "规律",
        //药品
      },
      drugValidateRules: {
        medicationAdherence: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
      },

      // 体检评价
      ruleForm10: {
        examAbnormalitiesListStatus: "无",
        //  异常
        examAbnormalitiesList: [
          //   {
          //   abnormalSituation:''
          // }
        ],
      },
      //健康指导
      ruleForm11: {
        healthGuidanceList: [],
        //  健康指导

        riskControlList: [],
        //  危险因素控制
        refusedTestsList: ["无"],
        //拒检项目
        riskControlOther: "",
        //危险控制因素其他
        refusalReasonList: [],
        //拒检原因

        refusalReasonListOther: "",
        //拒检原因其他
        // examination_date: "",
        //  体检日期
        exaDoctor: "",
        //  体检医生
        nextYearExaTime: "",
        //  下次年检日期
        inputPerson: "",
        //录入人
        createTime: "",
        // 创建时间
        importTime: "",
        //诊疗信息导入日期
      },
      rules11: {
        // healthGuidanceList: [
        //   {
        //     required: true,
        //     validator: validtrue,
        //     trigger: "blur",
        //   },
        // ],
        // riskControlList: [
        //   {
        //     required: true,
        //     validator: validtrue,
        //     trigger: "blur",
        //   },
        // ],
        refusedTestsList: [
          {
            required: true,
            validator: validtrue,
            trigger: "blur",
          },
        ],
        // nextYearExaTime: [
        //   {
        //     required: true,
        //     validator: validtrue,
        //     trigger: "blur",
        //   },
        // ],
      },
    };
  },

  methods: {
    disableFutureDates,
    //回车跳转

    nextInput(key, index) {
      if (this.$refs[key] && typeof this.$refs[key].focus === "function") {
        this.$refs[key].focus();
      }
      if (
        key == "missing_teeth" &&
        this.ruleForm5.teethAlignmentList.includes("龋齿")
      ) {
        this.$refs.cavities_top_left.focus();
      } else if (
        key == "missing_teeth" &&
        this.ruleForm5.teethAlignmentList.includes("义齿(假牙)")
      ) {
        this.$refs.dentures_top_left.focus();
      } else {
        if (key == "missing_teeth") {
          this.$refs.leftEyeInput.focus();
        }
      }
      if (
        key == "cavities" &&
        this.ruleForm5.teethAlignmentList.includes("义齿(假牙)")
      ) {
        this.$refs.dentures_top_left.focus();
      } else {
        if (key == "cavities") {
          this.$refs.leftEyeInput.focus();
        }
      }
      if (
        key === "drugInput" &&
        this.drugValidateForm.medicationList.length > 0 &&
        !index
      ) {
        return this.$refs.drugInput[0].focus();
      }

      if (index >= 0) {
        if (this.$refs[key][index]) {
          return this.$refs[key][index].focus();
        }
      }
    },
    querySearchAsync(queryString, cb) {
      clearTimeout(this.timeout);
      let results = [];
      // 掉接口需要的参数
      this.timeout = setTimeout(() => {
        const find = {
          name: queryString,
        };

        http.get("/health/searchDoctor", find).then((res) => {
          //@ts-ignore
          if (res.data.length > 0) {
            res.data.forEach((v) => {
              results.push({
                value: v.name,
                name: v.name,
              });
            });
            cb(results);
          } else {
            results = [];
            cb(results);
          }
        });
      }, 1000);
    },
    setBoxShadow(refName, color) {
      if (this.$refs[refName]) {
        //@ts-ignore
        this.$refs[refName].$el.querySelector(
          ".el-input__wrapper"
        ).style.boxShadow = `0 0 0 1px ${color} inset`;
      }
    },
    //打开老年人体检表
    openOld() {
      http
        .post("/health/findNodes", { id: this.ruleForm3.elderlyScoreId })
        .then((res) => {
          if (res.code === 200) {
            this.DialogDate = res.data;

            this.selfCareAssessmentVisible = true;
          }
        });
    },
    updateSelfCareAssessment(val) {
      this.selfCareAssessmentVisible = false;
      const rangeMap = {
        "可自理（0-3分）": [0, 3],
        "轻度依赖（4-8分）": [4, 8],
        "中度依赖（9-18分）": [9, 18],
        "不能自理（≥19分）": [19, Infinity],
      };
      let radioValue;
      Object.keys(rangeMap).forEach((key) => {
        const [min, max] = rangeMap[key];
        if (
          val.elderlySelfCareScore >= min &&
          val.elderlySelfCareScore <= max
        ) {
          radioValue = key;
          return;
        }
      });
      // todo - 保存更新的分值
      this.ruleForm3.elderlySelfCareScore = radioValue;
      this.ruleForm3.elderlyScoreId = val.elderlyScoreId;
    },

    //视力切换
    visionChange() {
      this.ruleForm5.leftEye = "";
      this.ruleForm5.rightEye = "";
      this.ruleForm5.visionList = [];
    },
    visionChange2() {
      this.ruleForm5.leftjzEye = "";
      this.ruleForm5.rightjzEye = "";
      this.ruleForm5.visionList = [];
    },
    debouncedleftEye(){
      this.ruleForm5.visionList[0]=this.ruleForm5.leftEye
    },
    debouncedrightEye(){
      this.ruleForm5.visionList[1]=this.ruleForm5.rightEye
    },
    debouncedleftjzEye(){
      this.ruleForm5.visionList[0]=this.ruleForm5.leftjzEye
    },
    debouncedrightjzEye(){
      this.ruleForm5.visionList[1]=this.ruleForm5.rightjzEye
    },
    //关闭弹窗
    cancel() {
      this.dialogObj.isDialogVisible = false;
    },
    //提交
    submit() {
      this.$refs.ruleFormRef.validate((valid) => {
        if (valid) {
          this.$refs.ruleFormRef2.validate((valid) => {
            if (valid) {
              this.$refs.ruleFormRef3.validate((valid) => {
                if (valid) {
                  this.$refs.ruleFormRef4.validate((valid) => {
                    if (valid) {
                      this.$refs.ruleFormRef5.validate((valid) => {
                        if (valid) {
                          this.$refs.ruleFormRef6.validate((valid) => {
                            if (valid) {
                              this.$refs.ruleFormRef7.validate((valid) => {
                                if (valid) {
                                  this.$refs.ruleFormRef8.validate((valid) => {
                                    if (valid) {
                                      this.$refs.ruleFormRef9.validate(
                                        (valid) => {
                                          if (valid) {
                                            this.$refs.drugValidateFormRef.validate(
                                              (valid) => {
                                                if (valid) {
                                                  this.$refs.ruleFormRef10.validate(
                                                    (valid) => {
                                                      if (valid) {
                                                        this.$refs.ruleFormRef11.validate(
                                                          (valid) => {
                                                            if (valid) {
                                                              this.ruleForm11.riskControlList =
                                                                [
                                                                  ...new Set(
                                                                    this.ruleForm11.riskControlList
                                                                  ),
                                                                ];

                                                              //处理视力
                                                              if (
                                                                this.ruleForm5
                                                                  .vision ==
                                                                "裸眼视力"
                                                              ) {
                                                                this.ruleForm5.visionList =
                                                                  [
                                                                    this
                                                                      .ruleForm5
                                                                      .leftEye,
                                                                    this
                                                                      .ruleForm5
                                                                      .rightEye,
                                                                  ];
                                                              } else if (
                                                                this.ruleForm5
                                                                  .vision ==
                                                                "矫正视力"
                                                              ) {
                                                                this.ruleForm5.visionList =
                                                                  [
                                                                    this
                                                                      .ruleForm5
                                                                      .leftjzEye,
                                                                    this
                                                                      .ruleForm5
                                                                      .rightjzEye,
                                                                  ];
                                                              }
                                                              //缺齿处理
                                                              let missingTeethList =
                                                                [];
                                                              missingTeethList.push(
                                                                this.ruleForm5
                                                                  .missing_teeth_top_left
                                                              );
                                                              missingTeethList.push(
                                                                this.ruleForm5
                                                                  .missing_teeth_bottom_left
                                                              );
                                                              missingTeethList.push(
                                                                this.ruleForm5
                                                                  .missing_teeth_top_right
                                                              );
                                                              missingTeethList.push(
                                                                this.ruleForm5
                                                                  .missing_teeth_bottom_right
                                                              );
                                                              this.ruleForm5.missingTeethList =
                                                                missingTeethList;
                                                              //义齿处理
                                                              let denturesList =
                                                                [];
                                                              denturesList.push(
                                                                this.ruleForm5
                                                                  .dentures_top_left
                                                              );
                                                              denturesList.push(
                                                                this.ruleForm5
                                                                  .dentures_bottom_left
                                                              );
                                                              denturesList.push(
                                                                this.ruleForm5
                                                                  .dentures_top_right
                                                              );
                                                              denturesList.push(
                                                                this.ruleForm5
                                                                  .dentures_bottom_right
                                                              );
                                                              this.ruleForm5.denturesList =
                                                                denturesList;
                                                              //龋齿处理
                                                              let cavitiesList =
                                                                [];
                                                              cavitiesList.push(
                                                                this.ruleForm5
                                                                  .cavities_top_left
                                                              );
                                                              cavitiesList.push(
                                                                this.ruleForm5
                                                                  .cavities_bottom_left
                                                              );
                                                              cavitiesList.push(
                                                                this.ruleForm5
                                                                  .cavities_top_right
                                                              );
                                                              cavitiesList.push(
                                                                this.ruleForm5
                                                                  .cavities_bottom_right
                                                              );
                                                              this.ruleForm5.cavitiesList =
                                                                cavitiesList;
                                                              let data = {
                                                                ...this
                                                                  .ruleForm,
                                                                ...this
                                                                  .ruleForm2,
                                                                ...this
                                                                  .ruleForm3,
                                                                ...this
                                                                  .ruleForm4,
                                                                ...this
                                                                  .ruleForm5,
                                                                ...this
                                                                  .ruleForm6,
                                                                ...this
                                                                  .ruleForm7,
                                                                ...this
                                                                  .ruleForm8,
                                                                ...this
                                                                  .ruleForm9,
                                                                ...this
                                                                  .drugValidateForm,
                                                                ...this
                                                                  .ruleForm10,
                                                                ...this
                                                                  .ruleForm11,
                                                              };
                                                              //删除无用数据
                                                              delete data.missing_teeth_top_left;
                                                              delete data.missing_teeth_bottom_left;
                                                              delete data.missing_teeth_top_right;
                                                              delete data.missing_teeth_bottom_right;
                                                              delete data.dentures_top_left;
                                                              delete data.dentures_bottom_left;
                                                              delete data.dentures_top_right;
                                                              delete data.dentures_bottom_right;
                                                              delete data.cavities_top_left;
                                                              delete data.cavities_bottom_left;
                                                              delete data.cavities_top_right;
                                                              delete data.cavities_bottom_right;
                                                              delete data.age;

                                                              http
                                                                .post(
                                                                  "/health/saveOrUpdateHealth",
                                                                  data
                                                                )
                                                                .then((res) => {
                                                                  //@ts-ignore
                                                                  if (
                                                                    res.code ===
                                                                    200
                                                                  ) {
                                                                    ElMessage.success(
                                                                      res.message
                                                                    );
                                                                    document
                                                                      .getElementById(
                                                                        "part1"
                                                                      )
                                                                      .scrollIntoView();
                                                                    this.dialogObj.isDialogVisible = false;
                                                                  }
                                                                  this.$emit(
                                                                    "update",
                                                                    ""
                                                                  );
                                                                });
                                                            } else {
                                                              document
                                                                .getElementById(
                                                                  "part12"
                                                                )
                                                                .scrollIntoView();
                                                            }
                                                          }
                                                        );
                                                      } else {
                                                        document
                                                          .getElementById(
                                                            "part11"
                                                          )
                                                          .scrollIntoView();
                                                      }
                                                    }
                                                  );
                                                } else {
                                                  document
                                                    .getElementById("part10")
                                                    .scrollIntoView();
                                                }
                                              }
                                            );
                                          } else {
                                            document
                                              .getElementById("part9")
                                              .scrollIntoView();
                                          }
                                        }
                                      );
                                    } else {
                                      document
                                        .getElementById("part8")
                                        .scrollIntoView();
                                    }
                                  });
                                } else {
                                  document
                                    .getElementById("part7")
                                    .scrollIntoView();
                                }
                              });
                            } else {
                              document.getElementById("part6").scrollIntoView();
                            }
                          });
                        } else {
                          document.getElementById("part5").scrollIntoView();
                        }
                      });
                    } else {
                      document.getElementById("part4").scrollIntoView();
                    }
                  });
                } else {
                  document.getElementById("part3").scrollIntoView();
                }
              });
            } else {
              document.getElementById("part2").scrollIntoView();
            }
          });
        } else {
          document.getElementById("part1").scrollIntoView();
        }
      });
    },
    //清空表单
    clearForm() {
      this.$refs.ruleFormRef.resetFields();
      this.$refs.ruleFormRef2.resetFields();
      this.$refs.ruleFormRef3.resetFields();
      this.$refs.ruleFormRef4.resetFields();
      this.$refs.ruleFormRef5.resetFields();
      this.$refs.ruleFormRef6.resetFields();
      this.$refs.ruleFormRef7.resetFields();
      this.$refs.ruleFormRef8.resetFields();
      this.$refs.ruleFormRef9.resetFields();
      this.$refs.drugValidateFormRef.resetFields();
      this.$refs.ruleFormRef10.resetFields();
      this.$refs.ruleFormRef11.resetFields();
      this.ruleForm.exaTime = this.getCurrentDate(); // 设置默认体检日期
      this.ruleForm11.nextYearExaTime = this.getNextYearDate(); //设置年检日期
      this.drugValidateForm.medicationList = [];
      this.ruleForm4.dietPartTwo = [];
      this.ruleForm4.otherProtectionOther = "";
      this.ruleForm5.missingTeethList = [];
      this.ruleForm5.cavitiesList = [];
      this.ruleForm5.denturesList = [];
      this.ruleForm5.visionList = [];
      this.ruleForm5.missing_teeth_top_left = "";
      this.ruleForm5.missing_teeth_bottom_left = "";
      this.ruleForm5.missing_teeth_top_right = "";
      this.ruleForm5.missing_teeth_bottom_right = "";
      this.ruleForm5.cavities_top_left = "";
      this.ruleForm5.cavities_bottom_left = "";
      this.ruleForm5.cavities_top_right = "";
      this.ruleForm5.cavities_bottom_right = "";
      this.ruleForm5.dentures_top_left = "";
      this.ruleForm5.dentures_bottom_left = "";
      this.ruleForm5.dentures_top_right = "";
      this.ruleForm5.dentures_bottom_right = "";
      this.ruleForm5.vision = "裸眼视力";
      this.ruleForm5.leftEye = "";
      this.ruleForm5.rightEye = "";
      this.ruleForm5.leftjzEye = "";
      this.ruleForm5.rightjzEye = "";
    },
    //弹窗关闭执行
    handleClose() {
      this.clearForm();
    },
    handleOpen() {
      clearTimeout(this.timeID);
      this.assignBigObjectToForms(this.dialogObj.DialogDate);
      this.$refs.ruleFormRef3.validate((valid) => {
        console.log("ruleFormRef3");
      });
      this.$refs.ruleFormRef4.validate((valid) => {});

      this.timeID = setTimeout(() => {
        this.$refs.ruleFormRef5.validate((valid) => {});
      }, 2000);
    },
    //处理危险因素
    extractTargets(riskControl) {
      // 匹配 "减腰围" 或 "减体重" 后面括号中的目标信息
      const regex = /(减腰围|减体重)\(目标\s+(\d+\.\d+)\s+(CM|KG)\)/g;
      let match;
      const results = [];

      // 使用正则表达式提取匹配项
      while ((match = regex.exec(riskControl)) !== null) {
        results.push(`${match[1]}(目标 ${match[2]} ${match[3]})`);
      }

      return results;
    },

    //打开老年人表
    openDialog() {},
    //用药显示
    getShow() {
      this.tipshow = false;
    },
    parseDate(value) {
      if (/^\d{8}$/.test(value)) {
        // 如果是 yyyymmdd 格式
        const year = value.slice(0, 4);
        const month = value.slice(4, 6) - 1; // JavaScript中的月份是从0开始的
        const day = value.slice(6, 8);
        return new Date(year, month, day);
      } else if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
        // 如果是 yyyy-mm-dd 格式
        return new Date(value);
      }
      return NaN;
    },
    //处理时间日期
    getNextYearDate() {
      const date = new Date();
      const nextYear = date.getFullYear() + 1;
      const month = String(date.getMonth() + 1).padStart(2, "0");
      const day = String(date.getDate()).padStart(2, "0");
      return `${nextYear}-${month}-${day}`;
    },
    getCurrentDate() {
      const date = new Date();
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, "0");
      const day = String(date.getDate()).padStart(2, "0");
      return `${year}-${month}-${day}`;
    },
    //症状互斥
    handleCheckboxChange(val) {
      if (val.includes("无症状") && val.length > 1) {
        this.ruleForm2.symptomList = ["无症状"];
      }

      // console.log("Checkbox group changed:", this.ruleForm2.symptomList);
    },
    handleCheckboxChange1() {
      this.ruleForm2.symptomList = this.ruleForm2.symptomList.filter(
        (item) => item !== "无症状"
      );
    },
    //咽部互斥
    changePharynx() {
      if (this.ruleForm5.throatList.includes("无充血")) {
        this.ruleForm5.throatList = ["无充血"];
      }
    },
    changePharynx2() {
      if (this.ruleForm5.throatList.includes("无充血")) {
        this.ruleForm5.throatList = this.ruleForm5.throatList.filter(
          (item) => item !== "无充血"
        );
      }
    },
    //齿列互斥
    changeDentalHealth(val) {
      this.ruleForm5.teethAlignmentList = ["正常"];
    },
    changeDentalHealth2() {
      this.ruleForm5.teethAlignmentList =
        this.ruleForm5.teethAlignmentList.filter((item) => item !== "正常");
    },
    //脑血管疾病互斥
    changeCereb() {
      if (this.ruleForm6.cerebrovascularDiseaseList.includes("无")) {
        this.ruleForm6.cerebrovascularDiseaseList = ["无"];
      }
    },
    changeCereb1() {
      this.ruleForm6.cerebrovascularDiseaseList =
        this.ruleForm6.cerebrovascularDiseaseList.filter(
          (item) => item !== "无"
        );
    },
    //肾脏疾病互斥
    changeRenal() {
      if (this.ruleForm6.kidneyDiseaseList.includes("无")) {
        this.ruleForm6.kidneyDiseaseList = ["无"];
      }
    },
    changeRenal1() {
      this.ruleForm6.kidneyDiseaseList =
        this.ruleForm6.kidneyDiseaseList.filter((item) => item !== "无");
    },
    //心脏疾病互斥
    changeCardiac() {
      if (this.ruleForm6.heartDiseaseList.includes("无")) {
        this.ruleForm6.heartDiseaseList = ["无"];
      }
    },
    changeCardiac1() {
      this.ruleForm6.heartDiseaseList = this.ruleForm6.heartDiseaseList.filter(
        (item) => item !== "无"
      );
    },
    //血管疾病互斥
    changeVascular() {
      if (this.ruleForm6.vascularDiseaseList.includes("无")) {
        this.ruleForm6.vascularDiseaseList = ["无"];
      }
    },
    changeVascular1() {
      this.ruleForm6.vascularDiseaseList =
        this.ruleForm6.vascularDiseaseList.filter((item) => item !== "无");
    },
    //眼部疾病互斥
    changeEye() {
      if (this.ruleForm6.eyeDiseaseList.includes("无")) {
        this.ruleForm6.eyeDiseaseList = ["无"];
      }
    },
    changeEye1() {
      this.ruleForm6.eyeDiseaseList = this.ruleForm6.eyeDiseaseList.filter(
        (item) => item !== "无"
      );
    },
    //淋巴结互斥
    changelymp() {
      this.ruleForm9.lymphNodesList = ["未触及"];
    },
    changelymp2() {
      this.ruleForm9.lymphNodesList = this.ruleForm9.lymphNodesList.filter(
        (item) => item !== "未触及"
      );
    },
    //肺部呼吸音互斥
    changeLung() {
      this.ruleForm9.ralesList = ["无"];
    },
    changeLung2() {
      this.ruleForm9.ralesList = this.ruleForm9.ralesList.filter(
        (item) => item !== "无"
      );
    },
    //足背动脉搏互斥
    changeHeart() {
      if (this.ruleForm9.dorsalPulsePartList.includes("未触及")) {
        this.ruleForm9.dorsalPulsePartList = ["未触及"];
      }
    },
    changeHeart2() {
      if (this.ruleForm9.dorsalPulsePartList.includes("触及双侧对称")) {
        this.ruleForm9.dorsalPulsePartList = ["触及双侧对称"];
      }
    },
    changeHeart3() {
      if (
        this.ruleForm9.dorsalPulsePartList.includes("触及左侧减弱或消失") ||
        this.ruleForm9.dorsalPulsePartList.includes("触及右侧减弱或消失")
      ) {
        this.ruleForm9.dorsalPulsePartList =
          this.ruleForm9.dorsalPulsePartList.filter(
            (item) =>
              item == "触及左侧减弱或消失" || item == "触及右侧减弱或消失"
          );
      }
    },
    //健康指导互斥
    headlthChange() {
      if (this.ruleForm11.healthGuidanceList.includes("建议复查")) {
        this.ruleForm11.healthGuidanceList =
          this.ruleForm11.healthGuidanceList.filter(
            (item) => item !== "建议转诊"
          );
      }
    },
    headlthChange2() {
      if (this.ruleForm11.healthGuidanceList.includes("建议转诊")) {
        this.ruleForm11.healthGuidanceList =
          this.ruleForm11.healthGuidanceList.filter(
            (item) => item !== "建议复查"
          );
      }
    },
    //拒检项目互斥
    rejectedChange() {
      this.ruleForm11.refusedTestsList = ["无"];
    },
    rejectedChange2() {
      if (this.ruleForm11.refusedTestsList.includes("无")) {
        this.ruleForm11.refusedTestsList =
          this.ruleForm11.refusedTestsList.filter((item) => item !== "无");
      }
    },

    //添加住院史
    addHosp() {
      this.ruleForm7.hospitalHistoryListStatus = "有";
      if (this.ruleForm7.hospitalHistoryList.length < 10) {
        this.ruleForm7.hospitalHistoryList.push({
          hospitalization_name: "",
          hospitalization_time: "",
          hospitalization_disease: "",
          hospitalization_disease_detail: "",
          hospitalization_disease_detail_other: "",
          hospitalization_disease_detail_other_detail: "",
        });
      }
    },
    //删除住院史
    moveHosp(item) {
      const index = this.ruleForm7.hospitalHistoryList.indexOf(item);
      if (index !== -1) {
        this.ruleForm7.hospitalHistoryList.splice(index, 1);
      }
    },
    changeHospital() {
      if (this.ruleForm7.hospitalHistoryList.length == 0) {
        this.addHosp();
      }
    },
    changeHospital2() {
      this.ruleForm7.hospitalHistoryList = [];
    },
    //添加家庭病床史
    addHome() {
      this.ruleForm7.familyBedHistoryListStatus = "有";
      if (this.ruleForm7.familyBedHistoryList.length < 10) {
        this.ruleForm7.familyBedHistoryList.push({
          medicalInstitutionName: "",
          //   医疗机构名称
          reason: "",
          //  入院原因
          bedEstablishedDate: "",
          // 建床日期
          bedRemovedDate: "",
          // 撤床日期
          medicalRecordNumber: "",
          //   病案号
        });
      }
    },
    //删除家庭病床史
    moveHome(item) {
      const index = this.ruleForm7.familyBedHistoryList.indexOf(item);
      if (index !== -1) {
        this.ruleForm7.familyBedHistoryList.splice(index, 1);
      }
    },
    changeHome() {
      if (this.ruleForm7.familyBedHistoryList.length == 0) {
        this.addHome();
      }
    },
    changeHome2() {
      this.ruleForm7.familyBedHistoryList = [];
    },
    //添加接种史
    addVacc() {
      this.ruleForm8.nonVaccineHistoryListStatus = "有";
      if (this.ruleForm8.nonVaccineHistoryList.length < 10) {
        this.ruleForm8.nonVaccineHistoryList.push({
          vaccineName: "",

          vaccinationDate: "",

          vaccinationSite: "",
        });
      }
    },
    //删除接种史
    moveVacc(item) {
      const index = this.ruleForm8.nonVaccineHistoryList.indexOf(item);
      if (index !== -1) {
        this.ruleForm8.nonVaccineHistoryList.splice(index, 1);
      }
    },
    changeVacc() {
      if (this.ruleForm8.nonVaccineHistoryList.length == 0) {
        this.addVacc();
      }
    },
    changeVacc2() {
      this.ruleForm8.nonVaccineHistoryList = [];
    },
    //添加药品
    addDrug() {
      this.drugValidateForm.medicationListStatus = "有";
      if (this.drugValidateForm.medicationList.length < 50) {
        this.drugValidateForm.medicationList.push({
          medicationName: "",
          //  药品名称
          medicationTime: "",
          //  用药时间
          medicationType: "外院",
          frequencyDay: "",
          //  频次
          frequencyCount: "",
          //  频次
          dosagePerDay: "",
          //  剂量
          dosagePerCount: "",
          //  剂量单位
        });
      }
    },
    //移除药品
    moveDrug(item) {
      const index = this.drugValidateForm.medicationList.indexOf(item);
      if (index !== -1) {
        this.drugValidateForm.medicationList.splice(index, 1);
      }
    },
    //添加体检评价
    addHealth() {
      this.ruleForm10.examAbnormalitiesListStatus = "有";
      if (this.ruleForm10.examAbnormalitiesList.length < 20) {
        this.ruleForm10.examAbnormalitiesListStatus = "有";
        this.ruleForm10.examAbnormalitiesList.push({
          abnormalSituation: "",
        });
      }
    },
    //删除体检评价
    moveHealth(item) {
      const index = this.ruleForm10.examAbnormalitiesList.indexOf(item);
      if (index !== -1) {
        this.ruleForm10.examAbnormalitiesList.splice(index, 1);
      }
    },
    changeHealth() {
      if (this.ruleForm10.examAbnormalitiesList.length == 0) {
        this.addHealth();
      }
    },
    changeHealth2() {
      this.ruleForm10.examAbnormalitiesList = [];
    },
    //入院日期规则
    validateAdmissionDate(rule, value, callback) {
      const dateFormat = /^(?:\d{4}-\d{2}-\d{2}|\d{8})$/;
      const currentDate = new Date();
      const oneYearAgo = new Date();
      oneYearAgo.setFullYear(currentDate.getFullYear() - 1);

      if (!value) {
        callback();
      } else {
        if (!dateFormat.test(value)) {
          callback(new Error("请输入 2020-01-01 或 20200101 格式日期"));
        } else {
          const date = this.parseDate(value);
          this.timeDate = date;
          if (isNaN(date)) {
            callback(new Error("请输入正确的日期"));
          } else if (date > currentDate) {
            callback(new Error("请输入正确的入院日期"));
          } else if (date < oneYearAgo) {
            callback(new Error("请输入正确的入院日期"));
          } else {
            callback();
          }
        }
      }
    },
    //  出院日期规则
    validateOutDate(rule, value, callback) {
      const dateFormat = /^(?:\d{4}-\d{2}-\d{2}|\d{8})$/;
      const currentDate = new Date();
      const oneYearAgo = new Date();
      oneYearAgo.setFullYear(currentDate.getFullYear() - 1);

      if (!value) {
        callback();
      } else {
        if (!dateFormat.test(value)) {
          callback(new Error("请输入 2020-01-01 或 20200101 格式日期"));
        } else {
          const date = this.parseDate(value);
          if (isNaN(date)) {
            callback(new Error("请输入正确的日期"));
          } else if (date < this.timeDate) {
            callback(new Error("请输入正确的出院日期"));
          } else {
            callback();
          }
        }
      }
    },
    //接种日期规则
    validateJzDate(rule, value, callback) {
      const dateFormat = /^(?:\d{4}-\d{2}-\d{2}|\d{8})$/;
      const currentDate = new Date();
      const oneYearAgo = new Date();
      oneYearAgo.setFullYear(currentDate.getFullYear() - 1);

      if (!value) {
        callback();
      } else {
        if (!dateFormat.test(value)) {
          callback(new Error("请输入 2020-01-01 或 20200101 格式日期"));
        } else {
          const date = this.parseDate(value);
          this.timeDate = date;
          if (isNaN(date)) {
            callback(new Error("请输入正确的日期"));
          } else if (date > currentDate) {
            callback(new Error("接种日期不能晚于当前日期"));
          } else {
            callback();
          }
        }
      }
    },
    //赋值
    assignBigObjectToForms(bigObject) {
      // this.clearForm();
      const forms = [
        "ruleForm",
        "ruleForm2",
        "ruleForm3",
        "ruleForm4",
        "ruleForm5",
        "ruleForm6",
        "ruleForm7",
        "ruleForm8",
        "ruleForm9",
        "drugValidateForm",
        "ruleForm10",
        "ruleForm11",
      ];
      forms.forEach((form) => {
        Object.keys(this[form]).forEach((key) => {
          if (bigObject.hasOwnProperty(key)) {
            this[form][key] = bigObject[key];
          }
        });
      });
    },
  },
  computed: {
    getruleForm() {
      const { birthday, exaTime } = this.ruleForm;
      return { birthday, exaTime };
    },
    getruleForm2() {
      const { populationCategoryList, symptomList } = this.ruleForm2;
      return { populationCategoryList, symptomList };
    },
    getruleForm3() {
      const {
        height,
        weight,
        waist,
        leftSystolic,
        leftDiastolic,
        rightSystolic,
        rightDiastolic,
        randomGlucose,
        fastingBloodGlucose,
        elderlySelfCareScore,
        pulse,
      } = this.ruleForm3;
      return {
        height,
        weight,
        waist,
        leftSystolic,
        leftDiastolic,
        rightSystolic,
        rightDiastolic,
        randomGlucose,
        fastingBloodGlucose,
        elderlySelfCareScore,
        pulse,
      };
    },
    getruleForm4() {
      const {
        weeklyExercises,
        smoking,
        drinkingFrequency,
        jobHazards,
        drinkTypeList,
      } = this.ruleForm4;
      return {
        weeklyExercises,
        smoking,
        drinkingFrequency,
        jobHazards,
        drinkTypeList,
      };
    },
    getruleForm5() {
      const {
        vision,
        missingTeethList,
        cavitiesList,
        denturesList,
        hearing,
        leftEye,
        rightEye,
        leftjzEye,
        rightjzEye,
        teethAlignmentList,
        visionList,
      } = this.ruleForm5;
      return {
        vision,
        missingTeethList,
        cavitiesList,
        denturesList,
        hearing,
        leftEye,
        rightEye,
        leftjzEye,
        rightjzEye,
        teethAlignmentList,
        visionList,
      };
    },
    getruleForm6() {
      const {
        cerebrovascularDiseaseList,
        kidneyDiseaseList,
        heartDiseaseList,
        vascularDiseaseList,
        eyeDiseaseList,
        nervousSystemDisease,
        otherSystemDisease,
      } = this.ruleForm6;
      return {
        cerebrovascularDiseaseList,
        kidneyDiseaseList,
        heartDiseaseList,
        vascularDiseaseList,
        eyeDiseaseList,
        nervousSystemDisease,
        otherSystemDisease,
      };
    },
    getruleForm9() {
      const {
        skin,
        sclera,
        lymphNodesList,
        barrelChest,
        breathSounds,
        ralesList,
        heartRhythm,
        heartRate,
        heartMurmur,
        abdominalMass,
        legEdema,
        dorsalPulsePartList,
        shiftingDullness,
        hepatomegaly,
        splenomegaly,
        abdominalTenderness,
      } = this.ruleForm9;
      return {
        skin,
        sclera,
        lymphNodesList,
        barrelChest,
        breathSounds,
        ralesList,
        heartRhythm,
        heartRate,
        heartMurmur,
        abdominalMass,
        legEdema,
        dorsalPulsePartList,
        shiftingDullness,
        hepatomegaly,
        splenomegaly,
        abdominalTenderness,
      };
    },
    getruleForm10() {
      const { examAbnormalitiesList, examAbnormalitiesListStatus } =
        this.ruleForm10;
      return { examAbnormalitiesList, examAbnormalitiesListStatus };
    },
    getruleForm11() {
      const { riskControlList, healthGuidanceList } = this.ruleForm11;
      return { riskControlList, healthGuidanceList };
    },
  },
  watch: {
    dialogObj: {
      handler(newVal, oldVal) {
        // this.$nextTick(() => {
        //   this.assignBigObjectToForms(newVal.DialogDate);
        // });
      },
      deep: true, // 深度监听，确保对象内部属性的变化也能被监听到
    },
    getruleForm(val) {
      const { birthday, exaTime } = val;
      const i = this.ruleForm.birthday?.split("-")[0];
      if (this.dialogObj.isDialogVisible) {
        if (i) {
          this.ruleForm.age = new Date().getFullYear() + "" - i;
          if (
            this.ruleForm.age >= 65 &&
            !this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            this.ruleForm2.populationCategoryList.push("老年人");
          }
        }
        if (exaTime) {
          const exaDate = new Date(exaTime); // 将 exaTime 转换为 Date 对象
          exaDate.setFullYear(exaDate.getFullYear() + 1); // 将年份增加1
          this.ruleForm11.nextYearExaTime = exaDate.toISOString().split("T")[0]; // 格式化为 YYYY-MM-DD 字符串
        }
      }
    },

    getruleForm2(val) {
      const bmiList = [
        { abnormalSituation: "体重过低，BMI＜18.5" },
        { abnormalSituation: "超重，28＞BMI≥24" },
        { abnormalSituation: "肥胖，BMI≥28" },
        { abnormalSituation: `腹型肥胖，腰围CM` },
        { abnormalSituation: `糖尿病，血糖控制不满意` },
        { abnormalSituation: `血糖升高，建议复查` },
        { abnormalSituation: `糖调节受损或糖尿病前期` },
      ];
      const { populationCategoryList, symptomList } = val;

      // 确保 populationCategoryList 是有效数组
      if (Array.isArray(populationCategoryList)) {
        const arr = [...new Set(populationCategoryList)];

        // 仅在去重后的数组与当前数组不同时更新
        if (
          JSON.stringify(arr) !==
          JSON.stringify(this.ruleForm2.populationCategoryList)
        ) {
          this.ruleForm2.populationCategoryList = arr;
        }
      }
      console.log(populationCategoryList);

      if (this.dialogObj.isDialogVisible) {
        if (populationCategoryList?.includes("其他")) {
          this.ruleForm2.crowdInput = true;
        } else {
          this.ruleForm2.crowdInput = false;
          this.ruleForm2.populationCategoryOther = "";
        }
        if (
          populationCategoryList?.includes("高血压") &&
          populationCategoryList?.includes("糖尿病")
        ) {
          this.ruleForm6.otherSystemDisease = "有";
          if (
            !this.ruleForm6.otherSystemDiseaseOther.includes(
              "高血压、2型糖尿病"
            )
          ) {
            this.ruleForm6.otherSystemDiseaseOther += "高血压、2型糖尿病";
          }

          //健康指导
          const index = this.ruleForm11.healthGuidanceList.findIndex(
            (item) => item === "纳入慢性病患者健康管理"
          );
          if (index == -1) {
            this.ruleForm11.healthGuidanceList.push("纳入慢性病患者健康管理");
          }
          const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[5].abnormalSituation
          );
          if (index1 !== -1) {
            this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            this.ruleForm10.examAbnormalitiesList.push(bmiList[4]);
          }
        } else if (populationCategoryList.includes("高血压")) {
          this.ruleForm6.otherSystemDisease = "有";
          if (!this.ruleForm6.otherSystemDiseaseOther.includes("高血压")) {
            this.ruleForm6.otherSystemDiseaseOther += "高血压";
          }

          const index = this.ruleForm11.healthGuidanceList.findIndex(
            (item) => item === "纳入慢性病患者健康管理"
          );
          if (index == -1) {
            this.ruleForm11.healthGuidanceList.push("纳入慢性病患者健康管理");
          }
          const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[4].abnormalSituation
          );
          if (index1 !== -1) {
            this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            this.ruleForm10.examAbnormalitiesList.push(bmiList[5]);
          }
        } else if (populationCategoryList?.includes("糖尿病")) {
          this.ruleForm6.otherSystemDisease = "有";
          if (!this.ruleForm6.otherSystemDiseaseOther.includes("2型糖尿病")) {
            this.ruleForm6.otherSystemDiseaseOther += "2型糖尿病";
          }

          const index = this.ruleForm11.healthGuidanceList.findIndex(
            (item) => item === "纳入慢性病患者健康管理"
          );
          if (index == -1) {
            this.ruleForm11.healthGuidanceList.push("纳入慢性病患者健康管理");
          }
          if (
            this.ruleForm3.randomGlucose >= 10 ||
            this.ruleForm3.fastingBloodGlucose >= 7
          ) {
            const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[4].abnormalSituation
            );
            if (index1 == -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[4]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[4].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
        } else {
          // this.ruleForm6.otherSystemDisease = "无";
          // this.ruleForm6.otherSystemDiseaseOther = "";
          const idnex1 = this.ruleForm11.healthGuidanceList.findIndex(
            (item) => item === "纳入慢性病患者健康管理"
          );

          if (idnex1 !== -1) {
            this.ruleForm11.healthGuidanceList.splice(idnex1, 1);
          }
        }
        if (symptomList.includes("其他")) {
          this.ruleForm2.symptomInput = true;
        } else {
          this.ruleForm2.symptomInput = false;
          this.ruleForm2.symptomOther = "";
        }
        if (!populationCategoryList?.includes("糖尿病")) {
          const index = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[4].abnormalSituation
          );
          if (index !== -1) {
            this.ruleForm10.examAbnormalitiesList.splice(index, 1);
          }
        }
        if (
          this.ruleForm3.randomGlucose >= 11.1 ||
          this.ruleForm3.fastingBloodGlucose >= 7.0
        ) {
          const tnbIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[5].abnormalSituation
          );
          const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[4].abnormalSituation
          );
          if (tnbIndex === -1 && index1 === -1) {
            this.ruleForm10.examAbnormalitiesList.push(
              bmiList[5].abnormalSituation
            );
          }
        } else {
          const index = this.ruleForm10.examAbnormalitiesList.findIndex(
            (item) => item.abnormalSituation === bmiList[5].abnormalSituation
          );
          if (index !== -1) {
            this.ruleForm10.examAbnormalitiesList.splice(index, 1);
          }
        }
      }
    },
    getruleForm3: {
      handler: debounce(function (newValue) {
        if (this.dialogObj.isDialogVisible) {
          const {
            height,
            weight,
            waist,
            leftSystolic,
            leftDiastolic,
            rightSystolic,
            rightDiastolic,
            randomGlucose,
            fastingBloodGlucose,
            elderlySelfCareScore,
            pulse,
          } = newValue;
          let bmi = 0;
          const bmiList = [
            { abnormalSituation: "体重过低，BMI＜18.5" },
            { abnormalSituation: "超重，28＞BMI≥24" },
            { abnormalSituation: "肥胖，BMI≥28" },
            { abnormalSituation: `腹型肥胖，腰围：${waist}CM` },
            { abnormalSituation: `糖尿病，血糖控制不满意` },
            { abnormalSituation: `血糖升高，建议复查` },
            { abnormalSituation: `高血压，血压控制不满意` },
            { abnormalSituation: `血压升高，建议复查` },
            { abnormalSituation: `生活自理能力异常：轻度依赖` },
            { abnormalSituation: `生活自理能力异常：中度依赖` },
            { abnormalSituation: `生活自理能力异常：不能自理` },
            { abnormalSituation: `糖调节受损或糖尿病前期` },
          ];
          let leftDifference = Math.abs(leftSystolic - leftDiastolic);
          let rightDifference = Math.abs(rightSystolic - rightDiastolic);

          //Bmi异常情况
          if (height && weight) {
            //@ts-ignore
            bmi = ((weight / (height * height)) * 10000).toFixed(2);
            if (bmi) {
              bmi = bmi;
            }
          }
          if (bmi < 18.5 && bmi !== 0) {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation.includes("体重过低")
            );

            if (index === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[0]);
            }
            let height1 = (height / 100).toFixed(1);
            //@ts-ignore
            let addwdith = 18.5 * height1 * height1;
            this.addWidth = `增体重(目标   ${addwdith.toFixed(1)}     KG)`;
            if (!this.ruleForm11.riskControlList.includes("其他")) {
              this.ruleForm11.riskControlList.push("其他");
              this.ruleForm11.riskControlOther = this.addWidth;
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation?.includes("体重过低")
            );

            this.addWidth = `增体重(目标     KG)`;
            if (!this.ruleForm11.riskControlList.includes("其他")) {
              this.ruleForm11.riskControlList =
                this.ruleForm11.riskControlList.filter(
                  (item) => item !== "其他"
                );
              this.ruleForm11.riskControlOther = "";
            }

            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (bmi >= 24 && bmi < 28) {
            const indexOf = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation.includes("超重")
            );
            if (indexOf === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[1]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[1].abnormalSituation
            );

            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (bmi >= 28) {
            const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation.includes("肥胖")
            );
            if (index1 === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[2]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[2].abnormalSituation
            );

            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (bmi >= 24) {
            let width = 0.95 * weight;
            this.moveWidth = `减体重(目标    ${width.toFixed(1)}   KG)`;
            const index = this.ruleForm11.riskControlList.findIndex((item) =>
              item.includes(this.moveWidth)
            );
            if (index == -1) {
              this.ruleForm11.riskControlList.push(this.moveWidth);
            }
          } else {
            this.moveWidth = `减体重(目标      KG)`;
            const index1 = this.ruleForm11.riskControlList.findIndex((item) =>
              item.includes("减体重")
            );
            if (index1 !== -1) {
              this.ruleForm11.riskControlList.splice(index1, 1);
            }
          }

          //腰围
          if (waist >= 90 && this.ruleForm.gender === "男") {
            const waisIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation.includes("腹型肥胖")
            );
            if (waisIndex === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[3]);
            }
            let waistScore = waist * 0.98;
            this.moveWaist = `减腰围(目标   ${waistScore.toFixed(1)}     CM)`;
            this.ruleForm11.riskControlList.push(this.moveWaist);
          } else if (waist >= 85 && this.ruleForm.gender === "女") {
            const waisIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation.includes("腹型肥胖")
            );
            if (waisIndex === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[3]);
            }
            let waistScore = waist * 0.98;
            this.moveWaist = `减腰围(目标   ${waistScore.toFixed(1)}     CM)`;
            this.ruleForm11.riskControlList.push(this.moveWaist);
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation?.includes("腹型肥胖")
            );
            const index1 = this.ruleForm11.riskControlList.findIndex((item) =>
              item.includes("减腰围")
            );

            this.moveWaist = `减腰围(目标        CM)`;
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
            if (index1 !== -1) {
              this.ruleForm11.riskControlList.splice(index1, 1);
            }
          }
          //血糖
          if (this.ruleForm2.populationCategoryList.includes("糖尿病")) {
            if (randomGlucose >= 10 || fastingBloodGlucose >= 7) {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[4].abnormalSituation
              );
              if (index === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[4]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[4].abnormalSituation
              );

              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
          }
          if (!this.ruleForm2.populationCategoryList.includes("糖尿病")) {
            if (randomGlucose >= 11.1 || fastingBloodGlucose >= 7) {
              const tnbIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[5].abnormalSituation
              );
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[4].abnormalSituation
              );

              if (tnbIndex === -1 && index === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[5]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[5].abnormalSituation
              );
              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
            // 非糖尿病患者6.1mmol/L≤空腹血糖<7.0mmol/L或7.8mmol/L<随机血糖<11.1mmol/L 时显示“糖调节受损或糖尿病前期
            if (
              (6.1 <= fastingBloodGlucose && fastingBloodGlucose < 7.0) ||
              (7.8 <= randomGlucose && randomGlucose < 11.1)
            ) {
              const tnbIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[11].abnormalSituation
              );
              if (tnbIndex === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[11]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[11].abnormalSituation
              );
              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
          }
          //转诊逻辑 空腹血糖或者随机血糖 小于等于3.9  大于等于16.7
          if (
            (fastingBloodGlucose && fastingBloodGlucose <= 3.9) ||
            (fastingBloodGlucose && fastingBloodGlucose >= 16.7) ||
            (randomGlucose && randomGlucose <= 3.9) ||
            (randomGlucose && randomGlucose >= 16.7)
          ) {
            console.log("转诊");
            const index = this.ruleForm11.healthGuidanceList.findIndex((item) =>
              item.includes("建议转诊")
            );
            if (index === -1) {
              this.ruleForm11.healthGuidanceList.push("建议转诊");
              this.healthTrue = true;
              this.ruleForm11.healthGuidanceList =
                this.ruleForm11.healthGuidanceList.filter(
                  (item) => item !== "建议复查"
                );
              console.log("转诊", this.ruleForm11.healthGuidanceList);
            }
          } else {
            this.healthTrue = false;
            if (!this.healthTrue) {
              this.ruleForm11.healthGuidanceList =
                this.ruleForm11.healthGuidanceList.filter(
                  (item) => item !== "建议转诊"
                );
            }
          }

          //高血压

          if (
            leftSystolic >= 180 ||
            leftDiastolic >= 110 ||
            rightSystolic >= 180 ||
            rightDiastolic >= 110 ||
            leftDifference > 20 ||
            rightDifference > 20
          ) {
            if (this.ruleForm11.healthGuidanceList.includes("建议复查")) {
              this.ruleForm11.healthGuidanceList =
                this.ruleForm11.healthGuidanceList.filter(
                  (item) => item !== "建议复查"
                );
            }
            const index = this.ruleForm11.healthGuidanceList.findIndex((item) =>
              item.includes("建议转诊")
            );
            if (index === -1) {
              this.ruleForm11.healthGuidanceList.push("建议转诊");
              this.referral = true;
            }
          } else {
            // if(!this.referral2){
            //   this.ruleForm11.healthGuidanceList =
            //     this.ruleForm11.healthGuidanceList.filter(
            //       (item) => item !== "建议转诊"
            //     );
            //     this.referral=false;
            // }
          }

          if (
            this.ruleForm.age < 65 &&
            this.ruleForm2.populationCategoryList.includes("高血压")
          ) {
            if (
              leftSystolic >= 140 ||
              leftDiastolic >= 90 ||
              rightSystolic >= 140 ||
              rightDiastolic >= 90
            ) {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[6].abnormalSituation
              );
              if (index === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[6]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[6].abnormalSituation
              );
              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
          }
          if (
            this.ruleForm.age >= 65 &&
            this.ruleForm2.populationCategoryList.includes("高血压")
          ) {
            if (
              leftSystolic >= 150 ||
              leftDiastolic >= 90 ||
              rightSystolic >= 150 ||
              rightDiastolic >= 90
            ) {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[6].abnormalSituation
              );
              if (index === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[6]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[6].abnormalSituation
              );
              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
          }
          if (!this.ruleForm2.populationCategoryList.includes("高血压")) {
            if (
              leftSystolic >= 140 ||
              leftDiastolic >= 90 ||
              rightSystolic >= 140 ||
              rightDiastolic >= 90
            ) {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[7].abnormalSituation
              );
              if (index === -1) {
                this.ruleForm10.examAbnormalitiesList.push(bmiList[7]);
              }
            } else {
              const index = this.ruleForm10.examAbnormalitiesList.findIndex(
                (item) =>
                  item.abnormalSituation === bmiList[7].abnormalSituation
              );
              if (index !== -1) {
                this.ruleForm10.examAbnormalitiesList.splice(index, 1);
              }
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[7].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          //生活能力

          if (elderlySelfCareScore == "轻度依赖（4-8分）") {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[8].abnormalSituation
            );
            if (index == -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[8]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[8].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (elderlySelfCareScore == "中度依赖（9-18分）") {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[9].abnormalSituation
            );
            if (index === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[9]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[9].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (elderlySelfCareScore == "不能自理（≥19分）") {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[10].abnormalSituation
            );
            if (index === -1) {
              this.ruleForm10.examAbnormalitiesList.push(bmiList[10]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === bmiList[10].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          //脉率
          if (pulse) {
            this.ruleForm9.heartRate = pulse;
          }
        }
      }, 1000),
      immediate: true,
    },
    getruleForm4(val) {
      if (this.dialogObj.isDialogVisible) {
        const {
          weeklyExercises,
          smoking,
          drinkingFrequency,
          jobHazards,
          drinkTypeList,
        } = val;
        if (weeklyExercises && weeklyExercises == 0) {
          this.ruleForm4.durationShow = false;
        } else {
          this.ruleForm4.durationShow = true;
        }
        if (smoking == "吸烟") {
          this.ruleForm11.riskControlList.push("戒烟");
          this.ruleForm4.quitSmokingAge = "";
        } else {
          const index = this.ruleForm11.riskControlList.indexOf("戒烟");
          if (index !== -1) {
            this.ruleForm11.riskControlList.splice(index, 1);
          }
        }
        if (drinkingFrequency !== "从不") {
          this.ruleForm11.riskControlList.push("健康饮酒");
        } else {
          const index = this.ruleForm11.riskControlList.indexOf("健康饮酒");
          if (index !== -1) {
            this.ruleForm11.riskControlList.splice(index, 1);
            this.ruleForm4.dailyDrinkAmount = "";
            this.ruleForm4.startDrinkingAge = "";
            this.ruleForm4.quitDrinking = "";
            this.ruleForm4.quitDrinkingAge = "";
            this.ruleForm4.quitDrinkingAge = [];
            this.ruleForm4.drunkInPastYear = "";
          }
        }
        if (smoking == "从不吸烟") {
          this.ruleForm4.dailySmoke = "";
          this.ruleForm4.startSmokingAge = "";
          this.ruleForm4.quitSmokingAge = "";
        } else if (smoking == "已戒烟") {
          this.ruleForm4.startSmokingAge = "";
        }
        if (jobHazards == "无") {
          this.ruleForm4.specificJob = "";
          this.ruleForm4.yearsOfService = "";
          this.ruleForm4.otherHazards = "";
          this.ruleForm4.otherProtection = "有";
          this.ruleForm4.otherProtectionOther = "";
        }
        if (!drinkTypeList.includes("其他")) {
          this.ruleForm4.drinkTypeListOther = "";
        }
      }
    },

    // getruleForm5(val) {

    // },
    getruleForm5: {
      handler: debounce(function (newValue,odlValue) {
        if (this.dialogObj.isDialogVisible) {
          const {
            vision,
            missingTeethList,
            cavitiesList,
            denturesList,
            hearing,
            leftEye,
            rightEye,
            leftjzEye,
            rightjzEye,
            teethAlignmentList,
            visionList,
          } = newValue;
          if (vision == "裸眼视力") {
            this.ruleForm5.leftEye = visionList[0];
            this.ruleForm5.rightEye = visionList[1];
          } else {
            this.ruleForm5.leftjzEye = visionList[0];
            this.ruleForm5.rightjzEye = visionList[1];
          }
          if (missingTeethList.length > 0) {
            this.ruleForm5.missing_teeth_top_left = missingTeethList[0];
            this.ruleForm5.missing_teeth_top_right = missingTeethList[1];
            this.ruleForm5.missing_teeth_bottom_left = missingTeethList[2];
            this.ruleForm5.missing_teeth_bottom_right = missingTeethList[3];
          }
          if (cavitiesList.length > 0) {
            this.ruleForm5.cavities_top_left = cavitiesList[0];
            this.ruleForm5.cavities_top_right = cavitiesList[1];
            this.ruleForm5.cavities_bottom_left = cavitiesList[2];
            this.ruleForm5.cavities_bottom_right = cavitiesList[3];
          }
          if (denturesList.length > 0) {
            this.ruleForm5.dentures_top_left = denturesList[0];
            this.ruleForm5.dentures_top_right = denturesList[1];
            this.ruleForm5.dentures_bottom_left = denturesList[2];
            this.ruleForm5.dentures_bottom_right = denturesList[3];
          }
          const otherList = [
            { abnormalSituation: "听力减弱" },
            { abnormalSituation: "龋齿，建议复查" },
          ];

          if (
            hearing == "听不清或无法听见" &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const heaIndex = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation == otherList[0].abnormalSituation
            );
            if (heaIndex == -1) {
              this.ruleForm10.examAbnormalitiesList.push(otherList[0]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) =>
                item.abnormalSituation === otherList[0].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (
            teethAlignmentList.includes("龋齿") &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const index1 = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) =>
                item.abnormalSituation === otherList[1].abnormalSituation
            );
            if (index1 == -1) {
              this.ruleForm10.examAbnormalitiesList.push(otherList[1]);
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) =>
                item.abnormalSituation === otherList[1].abnormalSituation
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
          }
          if (
            ((0.1 <= leftEye && leftEye < 1.0) ||
              (4.0 <= leftEye && leftEye < 5.0)) &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === "视力减退"
            );
            if (index == -1) {
              this.ruleForm10.examAbnormalitiesList.push({
                abnormalSituation: "视力减退",
              });
            }
            const index2 =
              this.ruleForm11.riskControlOther.includes("需佩戴眼镜");
            if (this.ruleForm11.riskControlList.includes("其他") && !index2) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
            } else if (
              !this.ruleForm11.riskControlList.includes("其他") &&
              !index2
            ) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
              this.ruleForm11.riskControlList.push("其他");
            }

            // else{
            //   if(index2==-1){
            //     this.ruleForm11.riskControlOther=this.ruleForm11.riskControlOther+'需佩戴眼镜'
            //   }
            // }
            // if (index == -1) {
            //   this.ruleForm10.examAbnormalitiesList.push({
            //     abnormalSituation: "视力减退",
            //   });
            // }
          } else if (
            ((0.1 <= rightEye && rightEye < 1.0) ||
              (4.0 <= rightEye && rightEye < 5.0)) &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === "视力减退"
            );
            if (index == -1) {
              this.ruleForm10.examAbnormalitiesList.push({
                abnormalSituation: "视力减退",
              });
            }
            const index2 =
              this.ruleForm11.riskControlOther.includes("需佩戴眼镜");
            if (this.ruleForm11.riskControlList.includes("其他") && !index2) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
            } else if (
              !this.ruleForm11.riskControlList.includes("其他") &&
              !index2
            ) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
              this.ruleForm11.riskControlList.push("其他");
            }
          } else if (
            ((0.1 <= leftjzEye && leftjzEye < 1.0) ||
              (4.0 <= leftjzEye && leftjzEye < 5.0)) &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === "视力减退"
            );
            if (index == -1) {
              this.ruleForm10.examAbnormalitiesList.push({
                abnormalSituation: "视力减退",
              });
            }
            const index2 =
              this.ruleForm11.riskControlOther.includes("需佩戴眼镜");
            if (this.ruleForm11.riskControlList.includes("其他") && !index2) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
            } else if (
              !this.ruleForm11.riskControlList.includes("其他") &&
              !index2
            ) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
              this.ruleForm11.riskControlList.push("其他");
            }
          } else if (
            ((0.1 <= rightjzEye && rightjzEye < 1.0) ||
              (4.0 <= rightjzEye && rightjzEye < 5.0)) &&
            this.ruleForm2.populationCategoryList.includes("老年人")
          ) {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === "视力减退"
            );
            if (index == -1) {
              this.ruleForm10.examAbnormalitiesList.push({
                abnormalSituation: "视力减退",
              });
            }
            const index2 =
              this.ruleForm11.riskControlOther.includes("需佩戴眼镜");
            if (this.ruleForm11.riskControlList.includes("其他") && !index2) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
            } else if (
              !this.ruleForm11.riskControlList.includes("其他") &&
              !index2
            ) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther + "需佩戴眼镜";
              this.ruleForm11.riskControlList.push("其他");
            }
          } else {
            const index = this.ruleForm10.examAbnormalitiesList.findIndex(
              (item) => item.abnormalSituation === "视力减退"
            );
            if (index !== -1) {
              this.ruleForm10.examAbnormalitiesList.splice(index, 1);
            }
            const index2 =
              this.ruleForm11.riskControlOther.includes("需佩戴眼镜");
            if (index2) {
              this.ruleForm11.riskControlOther =
                this.ruleForm11.riskControlOther.replace("需佩戴眼镜", "");
            }
            if (this.ruleForm11.riskControlOther == "") {
              this.ruleForm11.riskControlList =
                this.ruleForm11.riskControlList.filter(
                  (item) => item !== "其他"
                );
            }
          }
        }
      }, 1000),
      immediate: true,
    },
    getruleForm6: {
      handler(newValue, oldValue) {
        const {
          cerebrovascularDiseaseList,
          kidneyDiseaseList,
          heartDiseaseList,
          vascularDiseaseList,
          eyeDiseaseList,
          nervousSystemDisease,
          otherSystemDisease,
        } = newValue;
        if (!cerebrovascularDiseaseList.includes("其他")) {
          this.ruleForm6.cerebrovascularDiseaseOther = "";
        }
        if (!kidneyDiseaseList.includes("其他")) {
          this.ruleForm6.kidneyDiseaseOther = "";
        }
        if (!heartDiseaseList.includes("其他")) {
          this.ruleForm6.heartDiseaseOther = "";
        }
        if (!vascularDiseaseList.includes("其他")) {
          this.ruleForm6.vascularDiseaseOther = "";
        }
        if (!eyeDiseaseList.includes("其他")) {
          this.ruleForm6.eyeDiseaseOther = "";
        }
        if (nervousSystemDisease !== "有") {
          this.ruleForm6.nervousSystemDiseaseOther = "";
        }
        if (otherSystemDisease !== "有") {
          this.ruleForm6.otherSystemDiseaseOther = "";
        }
      },
      deep: true,
    },
    getruleForm9: {
      handler: debounce(function (newValue) {
        const {
          skin,
          sclera,
          lymphNodesList,
          barrelChest,
          breathSounds,
          ralesList,
          heartRhythm,
          heartRate,
          heartMurmur,
          legEdema,
          dorsalPulsePartList,
          shiftingDullness,
          abdominalTenderness,
          hepatomegaly,
          splenomegaly,
          abdominalMass,
        } = newValue;
        if (skin !== "其他") {
          this.ruleForm9.skinOther = "";
        }
        if (sclera !== "其他") {
          this.ruleForm9.scleraOther = "";
        }
        if (!lymphNodesList.includes("其他")) {
          this.ruleForm9.lymphNodesOther = "";
        }
        if (breathSounds !== "异常") {
          this.ruleForm9.breathSoundsOther = "";
        }
        if (!ralesList.includes("其他")) {
          this.ruleForm9.ralesListOther = "";
        }
        if (heartMurmur == "无") {
          this.ruleForm9.heartMurmurOther = "";
        }

        if (abdominalTenderness == "无") {
          this.ruleForm9.abdominalTendernessOther = "";
        }
        if (abdominalMass == "无") {
          this.ruleForm9.abdominalMassOther = "";
        }
        if (hepatomegaly == "无") {
          this.ruleForm9.hepatomegalyOther = "";
        }
        if (splenomegaly == "无") {
          this.ruleForm9.splenomegalyOther = "";
        }
        if (shiftingDullness == "无") {
          this.ruleForm9.shiftingDullnessOther = "";
        }
        if (
          skin == "黄染" ||
          sclera == "黄染" ||
          lymphNodesList.includes("锁骨上") ||
          lymphNodesList.includes("腋窝") ||
          breathSounds == "异常" ||
          ralesList.includes("干啰音") ||
          ralesList.includes("湿啰音") ||
          (heartRate > 0 && heartRate > 100) ||
          (heartRate > 0 && heartRate < 40) ||
          abdominalMass == "有" ||
          heartRhythm == "不齐" ||
          heartRhythm == "绝对不齐" ||
          dorsalPulsePartList.includes("触及触及左侧减弱或消失") ||
          dorsalPulsePartList.includes("触及右侧减弱或消失") ||
          shiftingDullness == "有" ||
          legEdema == "单侧" ||
          abdominalTenderness == "有" ||
          hepatomegaly == "有" ||
          splenomegaly == "有" ||
          heartMurmur == "有"
        ) {
          if (this.ruleForm11.healthGuidanceList.includes("建议复查")) {
            this.ruleForm11.healthGuidanceList =
              this.ruleForm11.healthGuidanceList.filter(
                (item) => item !== "建议复查"
              );
          }
          const index = this.ruleForm11.healthGuidanceList.findIndex((item) =>
            item.includes("建议转诊")
          );
          if (index === -1) {
            this.ruleForm11.healthGuidanceList.push("建议转诊");
            this.referral2 = true;
          }
        } else {
          if (!this.referral) {
            this.ruleForm11.healthGuidanceList =
              this.ruleForm11.healthGuidanceList.filter(
                (item) => !item.includes("建议转诊")
              );
            this.referral2 = false;
          }
        }
      }, 1000),
      immediate: true,
    },
    getruleForm10: {
      handler(newVal, oldVal) {
        const defaultAbnormalities = ["超重", "肥胖", "腹型肥胖"];
        const hasOtherAbnormalities = newVal.examAbnormalitiesList.some(
          (item) => defaultAbnormalities.includes(item)
        );
        const index = this.ruleForm11.healthGuidanceList.findIndex(
          (item) => item === item.includes("建议复查")
        );

        if (index == -1 && hasOtherAbnormalities) {
          this.ruleForm11.healthGuidanceList.push("建议复查");
        }
        if (!hasOtherAbnormalities) {
          const index = this.ruleForm11.healthGuidanceList.findIndex((item) =>
            item.includes("建议转诊")
          );
          if (index !== -1) {
            this.ruleForm11.healthGuidanceList =
              this.ruleForm11.healthGuidanceList.filter(
                (item) => item !== "建议复查"
              );
          }
        }
        const index2 = this.ruleForm11.healthGuidanceList.findIndex((item) =>
          item.includes("建议复查")
        );
        if (
          index2 == -1 &&
          !this.ruleForm11.healthGuidanceList.includes("建议复查")
        ) {
          this.ruleForm11.healthGuidanceList.push("建议复查");
          // console.log('执行了');
        }

        if (newVal.examAbnormalitiesList.length > 0) {
          this.ruleForm10.examAbnormalitiesListStatus = "有";
        } else {
          this.ruleForm10.examAbnormalitiesListStatus = "无";
        }
      },
      deep: true, // 深度监听，确保对象内部属性的变化也能被监听到
    },
    // getruleForm11:{
    //   handler(newValue, oldValue) {
    //     if(this.dialogObj.isDialogVisible){
    //    const {healthGuidanceList} = newValue;
    //    this.ruleForm11.healthGuidanceList = [...new Set(healthGuidanceList)]
    //    if(healthGuidanceList.includes('建议转诊')&&healthGuidanceList.includes('建议复查')){
    //     this.ruleForm11.healthGuidanceList =this.ruleForm11.healthGuidanceList.filter(item=>item!=='建议复查')
    //    }
    //    console.log('图片',this.ruleForm11.healthGuidanceList);

    //   }},
    //   deep: true
    // }
    getruleForm11: {
      handler(newValue, oldValue) {
        if (this.dialogObj.isDialogVisible) {
          const { healthGuidanceList } = newValue;
          // 确保只有当列表真正变化时才更新
          const uniqueHealthGuidanceList = [...new Set(healthGuidanceList)];
          if (
            uniqueHealthGuidanceList.includes("建议转诊") &&
            uniqueHealthGuidanceList.includes("建议复查")
          ) {
            // 过滤掉 "建议复查"
            const filteredList = uniqueHealthGuidanceList.filter(
              (item) => item !== "建议复查"
            );
            // 只有在列表发生变化时才更新
            if (
              JSON.stringify(filteredList) !==
              JSON.stringify(this.ruleForm11.healthGuidanceList)
            ) {
              this.ruleForm11.healthGuidanceList = filteredList;
            }
          } else {
            // 只有在列表发生变化时才更新
            if (
              JSON.stringify(uniqueHealthGuidanceList) !==
              JSON.stringify(this.ruleForm11.healthGuidanceList)
            ) {
              this.ruleForm11.healthGuidanceList = uniqueHealthGuidanceList;
            }
          }
          // console.log('图片', this.ruleForm11.healthGuidanceList);
        }
      },
      deep: true,
    },
  },
  mounted() {
    this.ruleForm.exaTime = this.getCurrentDate(); // 设置默认体检日期
    this.ruleForm11.nextYearExaTime = this.getNextYearDate(); //设置年检日期
  },
};
</script>

<style scoped>
.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-indicators {
  display: flex;
  width: 300px;
  justify-content: space-around;
}

.indicator {
  display: flex;
  align-items: center;
  margin-bottom: 8px; /* Adjust spacing between the two indicators */
}

.square {
  width: 20px;
  height: 20px;
  margin-right: 8px; /* Spacing between the square and the text */
}

.yellow {
  background-color: yellow;
}

.red {
  background-color: red;
}

.text {
  font-size: 14px;
  color: #333;
}

.button-group {
  display: flex;
  gap: 10px;
}
.residents-container {
  box-sizing: border-box;
  -ms-overflow-style: none !important; /* 适用于IE和Edge */
  scrollbar-width: none !important; /* 适用于Firefox */
}
.res-add-content {
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  -ms-overflow-style: none !important; /* 适用于IE和Edge */
  height: 500px;
}
/* .res-add-content::-webkit-scrollbar {
  display: none !important;
} */
.tip {
  font-size: 12px;
  color: red;
  z-index: 9;
  margin-left: 80px;
  display: block;
  height: 30px;
}
.ml20 {
  margin-left: 25px;
}
.flex {
  display: flex;
}
.el-radio.is-bordered {
  padding: 0 35px 0 35px;
  height: 32px;
}
.shell {
  width: 100%;
  border: 1px solid #ccc;
}
:deep(.el-checkbox-group) {
  display: flex;
  flex-wrap: wrap;
}
:deep(.el-form-item__label) {
  font-size: 16px !important;
}
:deep(.el-checkbox.el-checkbox--large .el-checkbox__label) {
  font-size: 16px !important;
}
:deep(.el-radio.el-radio--large .el-radio__label) {
  font-size: 16px !important;
}
:deep(.el-checkbox) {
  margin-right: 18px;
}
:deep(.el-input-group__append) {
  width: 20px;
}
/* :deep(.el-checkbox__inner) {
  border-radius: 50%;
} */
:deep(.el-dialog__header) {
  background-color: #016dff;
  margin: 0;
  height: 30px;
}
:deep(.el-dialog__title) {
  color: #fff;
}
:deep(.el-dialog__headerbtn .el-dialog__close) {
  color: #fff;
  font-size: 30px;
}
:deep(.el-form-item--large .el-form-item__content) {
  margin-left: 0 !important;
}
.title_box {
  width: 150px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  border: 1px solid #000;
  background-color: #ccc;
}
.iconBox {
  font-size: 25px;
  /* position: absolute;
  right: 168px;
  top: 68px; */
  cursor: pointer;
  margin-left: 15px;
}
.flexBox {
  display: flex;
}
</style>
